{"id":21716430,"url":"https://github.com/michaelconan/notion-habits","last_synced_at":"2026-04-14T01:31:07.397Z","repository":{"id":262016335,"uuid":"885991688","full_name":"michaelconan/notion-habits","owner":"michaelconan","description":"Simple Python application to create habit tracker records in Notion databases, executed via GitHub Actions","archived":false,"fork":false,"pushed_at":"2026-01-24T13:57:08.000Z","size":139,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-25T01:45:56.598Z","etag":null,"topics":["notion","python"],"latest_commit_sha":null,"homepage":"","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/michaelconan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-11-09T22:37:18.000Z","updated_at":"2026-01-24T13:57:09.000Z","dependencies_parsed_at":"2024-11-09T23:27:06.134Z","dependency_job_id":"e4261454-458b-44ae-a3a0-91070c92938b","html_url":"https://github.com/michaelconan/notion-habits","commit_stats":null,"previous_names":["michaelconan/notion-habits"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/michaelconan/notion-habits","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelconan%2Fnotion-habits","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelconan%2Fnotion-habits/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelconan%2Fnotion-habits/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelconan%2Fnotion-habits/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/michaelconan","download_url":"https://codeload.github.com/michaelconan/notion-habits/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelconan%2Fnotion-habits/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31778580,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T00:11:49.126Z","status":"ssl_error","status_checked_at":"2026-04-14T00:10:29.837Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["notion","python"],"created_at":"2024-11-26T01:10:58.494Z","updated_at":"2026-04-14T01:31:07.390Z","avatar_url":"https://github.com/michaelconan.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# notion-habits\n\nSimple Python application to create daily, weekly, and monthly habit tracker records in Notion databases, executed via GitHub Actions.\n\n## How It Works\n\nEach day, a GitHub Actions workflow runs at 03:00 UTC and creates new pages in your Notion habit databases:\n\n- **Daily** — created every day\n- **Weekly** — created on Mondays\n- **Monthly** — created on the 1st of each month\n\nEach record is linked to a summary page in a \"Habit Analytics\" database and stamped with the current date.\n\n## Prerequisites\n\n- A Notion workspace with the following databases: `Daily Disciplines`, `Weekly Disciplines`, `Monthly Disciplines`, and `Habit Analytics`\n- A [Notion integration](https://www.notion.so/profile/integrations) with access to those databases\n- Python 3.12 and [Pipenv](https://pipenv.pypa.io/)\n\n## Setup\n\n### 1. Configure your Notion integration\n\nCreate a Notion internal integration and copy the API key (format: `ntn_...`). Share each of the four databases with the integration from the Notion UI.\n\n### 2. Set up environment variables\n\n```sh\ncp example.env .env\n# Edit .env and set NOTION_API_KEY=ntn_YOURKEYHERE\n```\n\nPipenv loads `.env` automatically during local development.\n\n### 3. Install dependencies\n\n```sh\npipenv install\n```\n\n### 4. Configure GitHub Actions (for automated scheduling)\n\nAdd `NOTION_API_KEY` as a secret in a GitHub Actions environment named `notion`. The workflow in `.github/workflows/add_habits.yml` will pick it up automatically.\n\n## Usage\n\nRun the script manually to add a habit record:\n\n```sh\n# Add daily habit record\npipenv run python run.py --type daily\n\n# Add weekly habit record\npipenv run python run.py --type weekly\n\n# Add monthly habit record\npipenv run python run.py --type monthly\n```\n\n## Development\n\n```sh\n# Install dev dependencies\npipenv install --dev\n\n# Run tests (requires NOTION_API_KEY in environment)\npipenv run pytest tests/ --cov=src/\n```\n\n## Background\n\nI use Notion as a habit tracker. A new row needs to be added to each habit database each day/week/month to record habits for that period — Notion has no built-in way to do this automatically.\n\nI explored a few approaches before settling on Python + GitHub Actions:\n\n- **Zapier**: The free tier doesn't allow multi-step zaps, which are required here.\n- **Google Apps Script**: Works well; a legacy implementation lives in `gascript/` for reference.\n- **Python + GitHub Actions**: Better structure, easier testing, and a good opportunity to try GitHub Actions as a scheduling tool.\n\nDependencies are managed with [Pipenv](https://pipenv.pypa.io/). The Notion API is called directly using `requests` with a proper [Notion integration](https://www.notion.so/profile/integrations) API key rather than a browser cookie token.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelconan%2Fnotion-habits","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichaelconan%2Fnotion-habits","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelconan%2Fnotion-habits/lists"}