I'd like to use this project to clean-up everything from my ticktick account but I'm not able to even list all the projects. I've tried both API versions and failed.
API v1:
import json
from pyticktick import Client
client = Client(
v1_client_id="…",
v1_client_secret="…",
v1_token={
"value": "…"
"expiration": 1789377338,
},
)
projects = client.get_projects_v1()
for p in projects:
print(json.dumps(p.model_dump(mode="json"), indent=4))
and I'm getting a ton of errors like:
2026-03-18 10:37:45.102 | WARNING | pyticktick.settings:_get_v2_token:530 - Cannot signon to v2 without `v2_username` and `v2_password`
/home/lbalhar/.virtualenvs/ticktick/lib/python3.14/site-packages/pyticktick/settings.py:531: UserWarning: Cannot signon to v2 without `v2_username` and `v2_password`
warnings.warn(msg, UserWarning, stacklevel=1)
Traceback (most recent call last):
File "/home/lbalhar/Tools/ticktick-migrator/cleanup_APIv1.py", line 14, in <module>
projects = client.get_projects_v1()
File "/home/lbalhar/.virtualenvs/ticktick/lib/python3.14/site-packages/pyticktick/client.py", line 206, in get_projects_v1
return ProjectsRespV1.model_validate(resp)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
File "/home/lbalhar/.virtualenvs/ticktick/lib/python3.14/site-packages/pydantic/main.py", line 716, in model_validate
return cls.__pydantic_validator__.validate_python(
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
obj,
^^^^
...<5 lines>...
by_name=by_name,
^^^^^^^^^^^^^^^^
)
^
pydantic_core._pydantic_core.ValidationError: 123 validation errors for ProjectsRespV1
3.viewMode
Input should be 'list', 'kanban' or 'timeline' [type=literal_error, input_value='Column Order', input_type=str]
For further information visit https://errors.pydantic.dev/2.12/v/literal_error
4.viewMode
Input should be 'list', 'kanban' or 'timeline' [type=literal_error, input_value='', input_type=str]
For further information visit https://errors.pydantic.dev/2.12/v/literal_error
5.viewMode
Input should be 'list', 'kanban' or 'timeline' [type=literal_error, input_value='', input_type=str]
For further information visit https://errors.pydantic.dev/2.12/v/literal_error
6.viewMode
Input should be 'list', 'kanban' or 'timeline' [type=literal_error, input_value='', input_type=str]
For further information visit https://errors.pydantic.dev/2.12/v/literal_error
7.viewMode
Input should be 'list', 'kanban' or 'timeline' [type=literal_error, input_value='', input_type=str]
For further information visit https://errors.pydantic.dev/2.12/v/literal_error
with API v2 code and the workaround applied from #275 :
from pyticktick import Client
from pyticktick.models.v2 import PostBatchProjectV2
from pyticktick.pydantic import update_model_config
from pyticktick.models.v2.responses.user import UserSignOnV2
update_model_config(UserSignOnV2, extra="allow")
client = Client(
v2_username="…@gmail.com",
v2_password="…",
)
resp = client.get_batch_v2()
for p in resp.project_profiles:
print(p.id)
2026-03-18 10:41:15.580 | WARNING | pyticktick.settings:_get_v1_token:512 - Cannot signon to v1 without `v1_client_id` and `v1_client_secret`
/home/lbalhar/.virtualenvs/ticktick/lib/python3.14/site-packages/pyticktick/settings.py:513: UserWarning: Cannot signon to v1 without `v1_client_id` and `v1_client_secret`
warnings.warn(msg, UserWarning, stacklevel=1)
Traceback (most recent call last):
File "/home/lbalhar/.virtualenvs/ticktick/lib/python3.14/site-packages/pyticktick/models/v2/models.py", line 113, in override_forbid_extra_message_injector
return handler(data)
pydantic_core._pydantic_core.ValidationError: 1 validation error for ValidatorCallable
timeZone
Invalid timezone name. [type=TimeZoneName, input_value='0', input_type=str]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/lbalhar/Tools/ticktick-migrator/cleanup.py", line 13, in <module>
resp = client.get_batch_v2()
File "/home/lbalhar/.virtualenvs/ticktick/lib/python3.14/site-packages/pyticktick/client.py", line 1219, in get_batch_v2
return GetBatchV2.model_validate(resp)
~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
File "/home/lbalhar/.virtualenvs/ticktick/lib/python3.14/site-packages/pydantic/main.py", line 716, in model_validate
return cls.__pydantic_validator__.validate_python(
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
obj,
^^^^
...<5 lines>...
by_name=by_name,
^^^^^^^^^^^^^^^^
)
^
File "/home/lbalhar/.virtualenvs/ticktick/lib/python3.14/site-packages/pyticktick/models/v2/models.py", line 113, in override_forbid_extra_message_injector
return handler(data)
File "/home/lbalhar/.virtualenvs/ticktick/lib/python3.14/site-packages/pyticktick/models/v2/models.py", line 113, in override_forbid_extra_message_injector
return handler(data)
File "/home/lbalhar/.virtualenvs/ticktick/lib/python3.14/site-packages/pyticktick/models/v2/models.py", line 139, in override_forbid_extra_message_injector
raise ValidationError.from_exception_data(e.title, errors) from e
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
KeyError: "Invalid error type: 'TimeZoneName'"
I've tried the latest release 0.3.0 as well as the latest content of the main branch here.
What am I doing wrong?
I'd like to use this project to clean-up everything from my ticktick account but I'm not able to even list all the projects. I've tried both API versions and failed.
API v1:
and I'm getting a ton of errors like:
with API v2 code and the workaround applied from #275 :
I've tried the latest release 0.3.0 as well as the latest content of the main branch here.
What am I doing wrong?