{"id":23909682,"url":"https://github.com/astrabert/obsidian-digest","last_synced_at":"2025-04-15T21:25:16.686Z","repository":{"id":270970190,"uuid":"911821614","full_name":"AstraBert/obsidian-digest","owner":"AstraBert","description":"Superpower your Obsidian notes with Gemini-2 ","archived":false,"fork":false,"pushed_at":"2025-01-04T12:54:13.000Z","size":72,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-12T14:05:18.962Z","etag":null,"topics":["ai","discord-bot","docker-compose","gemini-api","llm","markdown","notes","obsidian-md","productivity","python-package"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/obsidian-digest/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AstraBert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-03T23:59:32.000Z","updated_at":"2025-01-20T01:29:34.000Z","dependencies_parsed_at":"2025-01-04T13:40:24.993Z","dependency_job_id":"0f20b1e7-bcbb-49a0-a519-f68b4747f991","html_url":"https://github.com/AstraBert/obsidian-digest","commit_stats":null,"previous_names":["astrabert/obsidian-digest"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AstraBert%2Fobsidian-digest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AstraBert%2Fobsidian-digest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AstraBert%2Fobsidian-digest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AstraBert%2Fobsidian-digest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AstraBert","download_url":"https://codeload.github.com/AstraBert/obsidian-digest/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249155701,"owners_count":21221647,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","discord-bot","docker-compose","gemini-api","llm","markdown","notes","obsidian-md","productivity","python-package"],"created_at":"2025-01-05T06:25:16.560Z","updated_at":"2025-04-15T21:25:16.663Z","avatar_url":"https://github.com/AstraBert.png","language":"Python","readme":"\u003cdiv align=\"center\"\u003e\r\n\u003ch1\u003eobsidian-digest\u003c/h1\u003e\r\n\u003ch2\u003eSuperpower your notes with Gemini 2\u003c/h2\u003e\r\n\u003c/div\u003e\r\n\u003cbr\u003e\r\n\u003cdiv align=\"center\"\u003e\r\n    \u003cimg src=\"https://raw.githubusercontent.com/AstraBert/obsidian-digest/main/logo.png\" alt=\"PdfItDown Logo\"\u003e\r\n\u003c/div\u003e\r\n\r\n🧠 **obsidian-digest** is a tool to superpower your [Obsidian](https://obsidian.md/) notes with LLM-based suggestions and considerations on style and contents!\r\n\r\n### ✅ Pre-requisites\r\n\r\n- (**mandatory**) an [Obsidian](https://obsidian.md/) account and the Desktop application installed\r\n- (**mandatory**) [`git` toolset](https://git-scm.com/docs)\r\n- (**mandatory**) A Gemini [API key](https://aistudio.google.com/apikey)\r\n- (**optional**) [`python`] 3.10 or following versions\r\n- (**optional**) [`conda`](https://docs.conda.io/projects/conda/en/latest/user-guide/getting-started.html) package manager\r\n- (**optional**) [`docker`](https://www.docker.com/) and [`docker compose`](https://docs.docker.com/compose/)\r\n- (**optional**) [Discord](https://discord.com/) and a Discord account\r\n\r\n### 🤝 Common Steps for Installation\r\n\r\nClone this GitHub repository and access it:\r\n\r\n```bash\r\ngit clone https://github.com/AstraBert/obsidian-digest.git\r\ncd obsidian-digest\r\n```\r\n\r\nMove `.env.example` to `.env` and fill in the variables there contained according to what reported in your preferred installation procedure:\r\n\r\n```bash\r\nmv .env.example .env\r\n```\r\n\r\n### 📦 1. Python Package\r\n\r\n\u003e _Pre-requistes: `python` 3.10 or following versions_\r\n\r\nIf you wish to install `obsidian-digest` as a Python package, you can do so just by running:\r\n\r\n```bash\r\npython3 -m pip install obsidian_digest\r\n```\r\n\r\nWhen the installation is complete, you can use the CLI tool following these instructions:\r\n\r\n```\r\nusage: obsidian_digest [-h] -d DIRECTORY [-a] -k APIKEY [-s]\r\n\r\noptions:\r\n  -h, --help            show this help message and exit\r\n  -d DIRECTORY, --directory DIRECTORY\r\n                        Directory containing Obsidian notes for which to produce the digest\r\n  -a, --allfiles        Produce the digest for all the files in the directory, and not only for those modified in the last hour\r\n  -k APIKEY, --apikey APIKEY\r\n                        Provide your Google Gemini API key either as a path to your .env file containing the\r\n                        GOOGLE_API_KEY variable, the name of the environmental variable under which the key is stored\r\n                        or the key itself (the first two methods are suggested)\r\n  -s, --save            Save the digest as a Markdown File in your Obsidia vault\r\n```\r\n\r\nExample usages could be:\r\n\r\n```bash\r\n# Get the digest for all files, save the digests and pass the API key as a .env file\r\nobsidian_digest -k ./envs/.env -d obsidian/notes/ -a -s\r\n# Get the digest only for the files you modified in the last hour, pass the API key as an environmental variable, do not save the digests\r\nobsidia_digest -k GEMINI_API -d obsidian/notes/\r\n```\r\n\r\nWe advise to use the `.env` file [template](./.env.example) from this repository, filling in only the variable `GOOGLE_API_KEY` with your API key. \r\n\r\n### 🤖 2. Discord Bot - Native Code\r\n\r\n\u003e _Pre-requistes: `python` 3.10 or following versions **or** `conda` package manager_\r\n\r\nFrom the repository that you cloned, you can create a python virtual environment and install all the dependencies in [`requirements.txt`](./requirements.txt): \r\n\r\n```bash\r\npython3 -m venv virtualenv\r\nsource virtualenv/bin/activate\r\npython3 -m pip install -r requirements.txt\r\n```\r\n\r\n**Alternatively**, if you have `conda`, you can create a conda environment named `obsidian-digest` from the [`conda_environment.yaml`](./conda_environment.yaml) configuration file in this repository: \r\n\r\n```bash\r\nconda env create -f conda_environment.yaml\r\nconda activate obsidian-digest\r\n```\r\n\r\nNow you should modify your `.env` file filling all the variables. If you don't know how to create a Discord bot and get its token and the channel ID, here is a quick breakdown:\r\n\r\n1. Go to [Discord](https://discord.com/) and create an account (or log into yours, if you already have one)\r\n2. Create a new server by clicking on \"Add a server\" (a big green \"+\" button) and name it as you want\r\n3. Go to [Discord developers portal](https://discord.com/developers/applications) and click on \"New application\"\r\n4. Name your application, than save the changes and click on \"Bot\", on the left\r\n5. There you will get the chance to name your bot and copy its token: paste it under the `discord_bot` field in your [`.env`](./.env.example) file.\r\n6. After that, go on OAuth2 \u003e URL generator and generate a URL that you will paste in your navigation bar, to add the bot to your newly created server.\r\n7. In the `channel_id` field in your [`.env`](./.env.example) file, insert the **last number** that is displayed in your server's **#general channel url** when you open it on the web.\r\n\r\nOnce you are done with all the set-up, simply run (from inside the virtual environment or from inside the conda environment):\r\n\r\n```bash\r\npython3 scripts/native/bot.py\r\n```\r\n\r\nThe bot will send a digest for all the files you modified in the hour before its activation, and it will keep sending hourly digest on the channel it was linked to.\r\n\r\n### 🐋 3. Discord Bot - Docker Compose\r\n\r\nUsing `docker compose` can make deployment easier, because it does not need any environment-setting steps, apart from setting the variables in the [`.env`](./.env.example) file as in option 2.\r\n\r\nYou can now run:\r\n\r\n```bash\r\ndocker compose up\r\n```\r\n\r\nAnd an image with all the required dependencies and [scripts](./scripts/docker/) will be built on the fly and used as a base for a container, in which our Discord bot will run. On the user side, the bot works in the same way as the one built from native code. \r\n\r\n### ⚙️ How does it work?\r\n\r\nThe overall workflow is pretty simple:\r\n\r\n- obsidian-digest finds the notes you worked on in the last hour under your vault path that you specified either as an option to the CLI tool or from the `NOTES_PATH` in the .env file\r\n- These files are uploaded to Gemini API, along with a prompt that asks Gemini to create a JSON answer, that contains style suggestions, content suggestions and overall considerations\r\n- Gemini's response is parsed and reconstructed into a message for each file\r\n- The final digest is then streamlined to the terminal (if you used the CLI tool) or to Discord (if you used one of the two Discord bot solutions)\r\n\r\n### 🎁 Contributing\r\n\r\nContributions are always welcome!\r\n\r\nFind contribution guidelines at [CONTRIBUTING.md](https://github.com/AstraBert/obsidian-digest/tree/main/CONTRIBUTING.md)\r\n\r\n### 💜 License and Funding\r\n\r\nThis project is open-source and is provided under an [MIT License](https://github.com/AstraBert/obsidian-digest/tree/main/LICENSE).\r\n\r\nIf you found it useful, please consider [funding it](https://github.com/sponsors/AstraBert).","funding_links":["https://github.com/sponsors/AstraBert"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastrabert%2Fobsidian-digest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fastrabert%2Fobsidian-digest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastrabert%2Fobsidian-digest/lists"}