Generated Computers
Locals: an Apple Silicon engine that runs local LLMs up to 3x faster. A product of Generated Computers.
翻译准备中
尚未检测到更新。GitHub 发布版本后会显示在这里。
个人 GitHub 账号下公开仓库的所有者可以登录并验证所有权,自行管理介绍,无需管理员批准。
登录并生成验证文件,在 30 分钟内将其提交到此仓库的默认分支。其他分支或分叉仓库中的文件无效。然后在下方检查文件,即可无需管理员批准直接管理项目。请保留文件以维持管理权限。
如需登录,将前往登录页面。登录后请回到此处,再次点击所选的验证按钮。
在项目文件夹中运行 /nomorevibe verify,即可验证所有权并自行管理介绍。
一分钟完成验证制作者的介绍仅有上面的一句话。 更多详情请阅读仓库 README。 仓库 README ↗
正在加载完整 README。
查看完整 README ↗This is the official Python SDK for the Todoist API.
pip install todoist-api-python
Or add the project as a dependency in pyproject.toml:
dependencies = [
"todoist-api-python>=3.1.0,<4",
]
Python version 3.10 and above.
Here's an example of initializing the API client, fetching a task, and paginating through its comments:
from todoist_api_python.api import TodoistAPI
api = TodoistAPI("YOUR_API_TOKEN")
task = api.get_task("6X4Vw2Hfmg73Q2XR")
print(f"Task: {task.content}")
comments_iter = api.get_comments(task_id=task.id)
for comments in comments_iter:
for comment in comments:
print(f"Comment: {comment.content}")
Always close TodoistAPIAsync explicitly, either via async with (recommended) or by calling await api.close().
from todoist_api_python.api_async import TodoistAPIAsync
async with TodoistAPIAsync("YOUR_API_TOKEN") as api:
task = await api.get_task("6X4Vw2Hfmg73Q2XR")
print(task.content)
For more detailed reference documentation, have a look at the SDK documentation and the API documentation.
Version 4.x introduces a breaking HTTP stack migration from requests to httpx2.
TodoistAPI(..., session=...) is now TodoistAPI(..., client=...) with httpx2.Client.TodoistAPIAsync(..., session=...) is now TodoistAPIAsync(..., client=...) with httpx2.AsyncClient.httpx2.HTTPStatusError instead of requests.exceptions.HTTPError.To install Python dependencies:
$ uv sync
To install pre-commit:
$ uv run pre-commit install
You can try your changes via REPL by running:
$ uv run python
You can then import the library as described in Usage without having to create a file.
If you decide to use TodoistAPIAsync, please keep in mind that you have to import asyncio
and run asyncio.run(yourmethod()) to make your async methods run as expected.
This API client is public, and available in a PyPI repository.
A new update is automatically released by GitHub Actions, by creating a release with a tag in the format vX.Y.Z (v<Major>.<Minor>.<Patch>).
Users of the API client can then update to the new version in their pyproject.toml file.
Any feedback, bugs, questions, comments, etc., can be reported as Issues in this repository.
We would love contributions! Pull requests are welcome.