{"id":49575244,"url":"https://github.com/rollecode/activitywatch-daily-export-to-md","last_synced_at":"2026-05-03T16:11:09.977Z","repository":{"id":259076697,"uuid":"876205247","full_name":"rollecode/activitywatch-daily-export-to-md","owner":"rollecode","description":"Export ActivityStats daily usage to md (for Obsidian for example).","archived":false,"fork":false,"pushed_at":"2024-10-21T17:10:11.000Z","size":5,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-05-02T13:33:27.836Z","etag":null,"topics":["activitywatch","activitywatch-export","markdown","obsidian","obsidian-md","python","python3","stats"],"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/rollecode.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":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-21T15:14:51.000Z","updated_at":"2026-01-30T19:31:35.000Z","dependencies_parsed_at":"2024-10-23T00:00:10.342Z","dependency_job_id":null,"html_url":"https://github.com/rollecode/activitywatch-daily-export-to-md","commit_stats":null,"previous_names":["ronilaukkarinen/activitywatch-daily-export-to-md","rollecode/activitywatch-daily-export-to-md"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rollecode/activitywatch-daily-export-to-md","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rollecode%2Factivitywatch-daily-export-to-md","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rollecode%2Factivitywatch-daily-export-to-md/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rollecode%2Factivitywatch-daily-export-to-md/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rollecode%2Factivitywatch-daily-export-to-md/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rollecode","download_url":"https://codeload.github.com/rollecode/activitywatch-daily-export-to-md/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rollecode%2Factivitywatch-daily-export-to-md/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32575404,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T06:36:36.687Z","status":"ssl_error","status_checked_at":"2026-05-03T06:36:09.306Z","response_time":103,"last_error":"SSL_read: 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":["activitywatch","activitywatch-export","markdown","obsidian","obsidian-md","python","python3","stats"],"created_at":"2026-05-03T16:11:09.291Z","updated_at":"2026-05-03T16:11:09.970Z","avatar_url":"https://github.com/rollecode.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ActivityWatch - Daily export to markdown\n\nThis Python script fetches [ActivityWatch](https://github.com/ActivityWatch/activitywatch) usage data via its API, processes it to calculate total computer usage time and the top 20 applications, and saves the output in both Markdown and JSON formats. The script uses an `.env` file to specify the save location and automatically overwrites the file for the same day with the latest data.\n\nMost suitable for macOS and Linux desktops.\n\n## Features\n\n- Fetches ActivityWatch data using `curl`.\n- Calculates the total computer usage time for the day.\n- Lists the top 20 applications by usage time.\n- Saves the output in both Markdown and JSON files, dated as `YYYY-MM-DD.md` and `YYYY-MM-DD.json`.\n- Uses the hostname of the machine in the report.\n- Automatically updates the report for the same day to avoid duplicates.\n\n## Requirements\n\n- Python 3.x\n- ActivityWatch installed and running\n- `python-dotenv` for environment variable management\n\n## Installation\n\n1. Clone the repository and navigate to the project folder.\n2. Install the required Python libraries:\n\n    ```bash\n    pip3 install -r requirements.txt\n    ```\n\n    on macOS:\n\n    ```bash\n    python3 -m venv path/to/venv\n    source path/to/venv/bin/activate\n    python3 -m pip install python-dotenv\n    ```\n\n3. Create a `.env` file in the project directory with the following content:\n\n    ```bash\n    SAVE_DIRECTORY=/path/to/your/save/directory\n    ```\n\n4. Modify the script to point to the correct URL for the ActivityWatch API (this is based on your hostname).\n\n## Usage\n\nRun the script to generate the daily summary:\n\n```bash\npython3 process.py\n```\n\n## Cron job\n\nTo automate the process, you can set up a cron job to run the script daily. Open the crontab editor with:\n\n```bash\ncrontab -e\n```\n\nAdd the following line to run the for every 1 minute:\n\n```bash\n* * * * * /usr/bin/python3 /path/to/process.py \u003e/dev/null 2\u003e\u00261\n```\n\nOr use the cron.sh provided for venv.\n\n```bash\n* * * * * /bin/bash /path/to/cron.sh \u003e/dev/null 2\u003e\u00261\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frollecode%2Factivitywatch-daily-export-to-md","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frollecode%2Factivitywatch-daily-export-to-md","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frollecode%2Factivitywatch-daily-export-to-md/lists"}