Hey, I'm Ranger and I have updated and tested on 29th July 2024.The Script has been testing on Macbook Pro M3 using Python version 3.11.8. This is now a fully working operating deathstar.
Todoist is a powerful task management app that helps you organize your life. With Todoist, you can create tasks and projects, set due dates and priorities, and even assign tasks to others. Todoist syncs across all your devices, so you can manage your tasks wherever you are. It also integrates with many other apps and services, including Gmail, Google Calendar, Slack, Amazon Alexa, and more. Whether you're managing a team, writing an epic screenplay, or just making a grocery list, Todoist is there to help you achieve more every day.
I had an idea if I could connect Todoist to my original todo_list program I made (Not uploaded yet) for Powershell, the Powershell todo_list was finished, and I thought if I could connect my todo_list to Todoist. This script does not do that, this script is to let you control your Todoist from the terminal or command line. This script lets you do most things available with this code. I copied and pasted all the code from the Todoist API guide, and with the help of GitHUb CoPilot we arrived at this script. Please enjoy and upgrade and own it.
The Todoist CLI is a Python script that interacts with the Todoist API to provide a command-line interface for managing your Todoist tasks.
The script uses the todoist-python
package to interact with the Todoist API and the python-dotenv
package to load environment variables from a .env file. The environment variable TODOIST_API_KEY
is used to authenticate with the Todoist API.
When you run the script, it displays a menu of options for managing your Todoist tasks. You can list, add, update, close, reopen, and delete tasks. You can also manage projects and comments. In addition, you can open the Todoist web app to view today's tasks and your active projects.
Here's how it works:
- The script loads your Todoist API key from a .env file using
python-dotenv
. - It creates a
TodoistAPI
object using your API key. - It displays a menu of options and asks you to choose an option.
- Depending on your choice, it calls a function to perform the chosen operation. For example, if you choose to list tasks, it calls the
get_tasks
method on theTodoistAPI
object and then prints the tasks. - If an operation requires user input, such as adding a task, it prompts you to enter the necessary information.
- After performing an operation, it goes back to step 3, unless you choose to exit the script.
This script provides a quick and easy way to manage your Todoist tasks from your terminal. It's especially useful if you prefer using the command line over a graphical user interface, or if you want to automate your task management with scripts.
- git clone https://github.com/davidtkeane/todoist-cli-python-api.git
- cd todoist-cli-python-api/help_files.
- The install.py file is inside the Help_files folder.
- The requirements.txt file is inside the Help_files folder.
- Extra Help to install Todoist file is inside the Help_files folder. File name is todoist_install_help.md
- Get your API key. It's free. Click here to get your Todoist API Key
- Add API Key into the .env file 'TODOIST_API_KEY=YourKey'.
- Then test the API key with the file todoist_api_test.py which is inside the Help_files folder.
python todoist_api_test.py
- After everything is installed you can start the script by this comand.
python todoist.py
- Login with a new account or old account.
- Then go to today Todoist Website for the API Key.
- Click your profile name and settings.
- Click Integrations.
- Click Developer.
- Copy API Token.
- Add to API Key when the install.py asks for it. The .env file will be created if the file is not there.
- Developing with Todoist website
- Todoist REST API. This is the link this script uses
https://developer.todoist.com/rest/v2/#overview
- When in the Todoist settings, you will find the REST API which is the https: link above to communicate over the internet.
-
Clone this repository to your local machine.
git clone https://github.com/davidtkeane/todoist-cli-python-api.git
-
First. Click here for the Todoist Website and get your API Key, then Copy the Key.
-
The Menu has instructions on how to find the API key shown below.
1. Login with a new account or old account. 2. Then go to today https://app.todoist.com/app/today 3. Click your profile name and settings. 4. Click Integrations 5. Click Developer 6. Copy API Token 7. Add to .env file
-
Run the install.py file. This will tell you if you have the modules needed installed.
-
You only need to run install_todoist.py once per install.
python install.py
-
You will get this menu.
-
The script will ask you for the Todoist API key in the terminal, then that is sent into the .env file for you.
-
It shows you that The following modules are required:
-
If the modules are installed it will say, if not it will ask you to install them.
-
If the modules are not installed, it will asked you to install The todoist module is not installed. Do you want to install todoist? This module is safe and used by millions. (y/n)
-
Press y for yes.
-
- The script will then run the todoist_api_test.py file to establish if you are able to connect to Todo
-
-
Press y for yes run the script.
The Normal way to run the app after the install will be
python todoist.py
To use the todoist.py
script, you can run the following command in PowerShell or Linux/Mac terminal:
Run the script from your terminal with the following command:
python todoist.py
==============================
- List projects
- Add project
- Delete project
- List tasks
- Add task
- Update task
- Close task
- Reopen task
- Delete task
- List comments
- Add comment
- Update comment
- Delete comment
- View today's tasks online
- View projects online
- Exit
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License.
If you have any questions, feel free to reach out to me at rangersmyth.74@gmail.com