A tool to sync GitHub issues and PRs to Todoist tasks.
Project description
GitHub Todoist Sync
A Python tool that synchronizes your GitHub issues and pull requests (PRs) with Todoist tasks. It creates Todoist tasks for issues and PRs assigned to you, created by you, or where you're mentioned, and updates tasks when items are closed on GitHub.
Features
- Sync GitHub Issues and PRs: Automatically create Todoist tasks for GitHub issues and PRs that are relevant to you.
- Repository to Project Mapping: Map specific GitHub repositories to Todoist projects for organized task management.
- Automatic Labeling: Add labels to tasks based on item type (
issue
orpr
) and your relation (assigned
,mentioned
,created
,review
). - Closed Item Tracking: When an issue or PR is closed on GitHub, the corresponding Todoist task is updated with a
"Closed"
label. - Cross-Platform Configuration: Uses a configuration directory in the user's home folder, compatible with Windows, Linux, and macOS.
Installation
Prerequisites
- Python 3.6 or higher installed on your system.
- GitHub Personal Access Token:
- Go to your GitHub account settings.
- Navigate to Developer settings > Personal access tokens.
- Generate a new token with the
repo
scope to access repository issues and PRs.
- Todoist API Token:
- Log in to your Todoist account.
- Go to Settings > Integrations.
- Copy your API token.
Install via pip
pip install github-todoist-sync
Configuration
Initialize Configuration
After installation, run the following command to create the default configuration files:
github-todoist-sync-init
This command creates the configuration directory and default config files in your home directory:
- Windows:
C:\Users\YourUsername\AppData\Roaming\github_todoist_sync\
- Linux/macOS:
/home/yourusername/.config/github_todoist_sync/
Update config.json
Navigate to the configuration directory and open config.json
. Update it with your actual GitHub and Todoist API tokens, GitHub username, and repository-to-project mappings.
Example config.json
:
{
"GITHUB_TOKEN": "your_actual_github_token",
"TODOIST_TOKEN": "your_actual_todoist_token",
"USERNAME": "your_github_username",
"REPO_PROJECT_MAPPING": {
"owner1/repo1": "Todoist Project 1",
"owner2/repo2": "Todoist Project 2"
}
}
GITHUB_TOKEN
: Your GitHub personal access token.TODOIST_TOKEN
: Your Todoist API token.USERNAME
: Your GitHub username.REPO_PROJECT_MAPPING
: A mapping of GitHub repositories to Todoist project names.
Permissions
Ensure that the configuration files are secure:
-
On Unix systems, you can set the config file permissions to be readable and writable only by you:
chmod 600 config.json
Usage
After configuring the tool, you can run the synchronization script:
github-todoist-sync
- The script fetches your GitHub issues and PRs.
- Creates Todoist tasks for new items.
- Updates tasks for closed items by adding a
"Closed"
label. - Tasks are added to the specified Todoist projects and labeled accordingly.
Labels Added to Tasks
- For Issues:
issue:assigned
issue:mentioned
issue:created
- For Pull Requests:
pr:assigned
pr:mentioned
pr:created
pr:review
- When Closed:
Closed
Project Structure
github_todoist_sync/
├── github_todoist_sync/
│ ├── __init__.py
│ └── sync.py
├── pyproject.toml
└── README.md
Contributing
Contributions are welcome! Please follow these steps:
-
Fork the repository on GitHub.
-
Clone your fork:
git clone https://github.com/yourusername/github-todoist-sync.git
-
Create a new branch for your feature or bugfix:
git checkout -b feature-or-bugfix-name
-
Make your changes and commit them:
git commit -am "Description of changes"
-
Push to your fork:
git push origin feature-or-bugfix-name
-
Submit a pull request to the main repository.
Troubleshooting
-
Authentication Errors:
- Ensure your API tokens are correct and have the necessary permissions.
- Double-check that you copied the entire token without extra spaces.
-
Permission Issues:
- If the script can't read or write configuration files, check the file permissions.
- Ensure the config directory is writable by your user account.
-
Label or Project Not Found:
- Verify that the Todoist project names in
REPO_PROJECT_MAPPING
match exactly with those in your Todoist account. - Labels are created automatically; ensure your Todoist account allows label creation.
- Verify that the Todoist project names in
-
API Rate Limits:
- Be aware of GitHub and Todoist API rate limits.
- If you encounter rate limit issues, consider running the script less frequently.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Contact
For any questions or support, please open an issue on the GitHub repository.
Acknowledgements
- PyGithub - A Python library to access the GitHub API.
- Todoist API Python - Official Todoist Python SDK.
Happy task management!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file github_todoist_sync-0.1.1.tar.gz
.
File metadata
- Download URL: github_todoist_sync-0.1.1.tar.gz
- Upload date:
- Size: 5.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ff1c2f606d657c4a25b91c624f1b58818d7c93cfd537314e9c4164f841c0f0d |
|
MD5 | fa0928d459462800a8104593af2b688f |
|
BLAKE2b-256 | cfe5a00c7b5ad712aa2a6930430e95e3c5b741715b23ed2386367f6572a19cc8 |
Provenance
The following attestation bundles were made for github_todoist_sync-0.1.1.tar.gz
:
Publisher:
release.yml
on 1337-42/Github2Todoist
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
github_todoist_sync-0.1.1.tar.gz
- Subject digest:
8ff1c2f606d657c4a25b91c624f1b58818d7c93cfd537314e9c4164f841c0f0d
- Sigstore transparency entry: 148607292
- Sigstore integration time:
- Predicate type:
File details
Details for the file github_todoist_sync-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: github_todoist_sync-0.1.1-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 23b0ae4e12dd1535ba91bfd0bf7e62ef08995c73fba30f97d186087d24745af0 |
|
MD5 | bdc072e07d83db9e7361d78d9b8b3b31 |
|
BLAKE2b-256 | abb5f61730720b4117c19dad4aad1bc11b1ed46c142b8fef2cba7e120186b10f |
Provenance
The following attestation bundles were made for github_todoist_sync-0.1.1-py3-none-any.whl
:
Publisher:
release.yml
on 1337-42/Github2Todoist
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
github_todoist_sync-0.1.1-py3-none-any.whl
- Subject digest:
23b0ae4e12dd1535ba91bfd0bf7e62ef08995c73fba30f97d186087d24745af0
- Sigstore transparency entry: 148607293
- Sigstore integration time:
- Predicate type: