The Todoist Data Exporter is a Python script that exports data from Todoist, including projects, tasks, labels, sections, and comments, into CSV files. This tool enables users to analyze and visualize their Todoist data independently.
- Exports Projects with metadata like project names, IDs, and colors.
- Exports Tasks (both active and completed) with details like content, due dates, labels, and project association.
- Exports Labels created in Todoist.
- Exports Sections within projects.
- Exports Comments associated with tasks and projects.
- Python 3.7 or above
- A Todoist API token (obtainable from your Todoist account under Settings > Integrations)
-
Clone the repository:
git clone https://github.com/yourusername/todoist-data-exporter.git cd todoist-data-exporter
-
Install required packages:
pip install -r requirements.txt
-
Configure your API token:
- Create a
config.json
file in the project root with your Todoist API token:
{ "TOKEN": "your_todoist_api_token_here" }
- Create a
Run the exporter script to export data to CSV files:
python src/exporter.py
This will generate CSV files in the default data
directory:
projects.csv
– list of all projectstasks.csv
– list of all active taskstasks_completed.csv
– list of completed taskslabels.csv
– list of labelssections.csv
– list of sections per projectcomments.csv
– list of comments on tasks
You can specify which entities to export using command-line arguments. Here are some examples:
-
Export only projects and tasks:
python src/exporter.py --projects --tasks
-
Export all entities with
--all
flag:python src/exporter.py --all
-
Specify an output directory other than the default
data/
:python src/exporter.py --all --output_dir="custom_data"
-
Enable verbose output for debugging:
python src/exporter.py --all --verbose
Use --help
for a full list of options:
python src/exporter.py --help
--all
: Export all entities (projects, tasks, completed tasks, labels, sections, and comments).--output_dir
: Specify a custom directory to save CSV files.--projects
: Export only projects.--tasks
: Export only active tasks.--completed_tasks
: Export only completed tasks.--labels
: Export only labels.--sections
: Export only sections.--comments
: Export only comments.--verbose
: Enable detailed logging output.
Run tests using unittest
with the following command:
python -m unittest discover -s tests
This will create temporary CSV files in the test_data
directory. Ensure test_data
is listed in .gitignore
to avoid committing test output files.
- Fork this repository.
- Create a new branch (
git checkout -b feature-branch
). - Commit your changes (
git commit -am 'Add new feature'
). - Push to the branch (
git push origin feature-branch
). - Create a new Pull Request.
This project is licensed under the MIT License. See LICENSE
for more information.
- Thanks to Doist for providing the Todoist API.
Feel free to contact me for questions or suggestions!