Skip to main content

API wrapper for the unofficial TickTick v2 API to access Tasks, Habits and Focus Times data

Project description

📦 TickTick-Unofficial-Api

TickTick-Unofficial-Api is a Python wrapper for the unofficial TickTick API (v2). It provides access to task, focus, and habit data, and currently supports reading and writing habit entries. Authentication is handled via cookies retrieved either through Selenium or manually extracted browser sessions.

✨ Features

  • Retrieve and add TickTick habit entries
  • Retrieve TickTick focus time data
  • Retrieve TickTick tasks (also supported by the official v1 API)

Planned features:

  • Add support for writing focus sessions
  • Add support for creating and updating tasks

🗂️ Project Structure

src/  
└── ticktick_v2/  
    ├── utils/                 utility functions  
    ├── web/                   web-related functionality (e.g., Selenium login)  
    ├── cookies_login.py       handles cookie retrieval via Selenium  
    ├── focus.py               focus session access  
    ├── habits.py              habit access and writing  
    └── tasks.py               task access

📥 Installation

To use the package, add authentication and install via:
pip install ticktick-py-v2

🚀 Usage

You can use the module by importing ticktick_v2:

from ticktick_v2.habits import TicktickHabitHandler, TickTickHabitEntry 
from ticktick_v2.focus import TicktickFocusHandler, TickTickFocusTime
from ticktick_v2.tasks import TicktickTaskHandler, TickTickTask

All return values use pydantic BaseModel for data validation. To use data as dict, simply convert via .dict()

🔐 Authentication

To access your TickTick data, you must authenticate using one of two methods:

Method 1: Environment Variables + Selenium

Set the following environment variables:
TICKTICK_USERNAME="your_email@example.com"
TICKTICK_PASSWORD="your_password"

The package will use a headless Selenium session to retrieve the necessary cookies for API access.

Method 2: Pre-saved Cookies

Create a file named .ticktick-cookies in your working directory. This file should contain cookies exported from a logged-in TickTick browser session (e.g., using browser developer tools).

🤝 Contributing

Contributions are welcome. Please open issues or pull requests for new features, improvements, or bug fixes.

🪪 License

This project is licensed under the Apache License 2.0. See the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ticktick_py_v2-0.24.1.tar.gz (15.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ticktick_py_v2-0.24.1-py3-none-any.whl (19.1 kB view details)

Uploaded Python 3

File details

Details for the file ticktick_py_v2-0.24.1.tar.gz.

File metadata

  • Download URL: ticktick_py_v2-0.24.1.tar.gz
  • Upload date:
  • Size: 15.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.12.2 Windows/11

File hashes

Hashes for ticktick_py_v2-0.24.1.tar.gz
Algorithm Hash digest
SHA256 f2f394001e144a1e0f43605133d7de8d153767f31d504c117bdbdc0ef3c1b31e
MD5 ff9a53b2c3ed6f905d19b2973a049a26
BLAKE2b-256 868f7ff4ae6fa247ee60697d74cd212c4ab0d064847dd56eaa1800493cce2c8d

See more details on using hashes here.

File details

Details for the file ticktick_py_v2-0.24.1-py3-none-any.whl.

File metadata

  • Download URL: ticktick_py_v2-0.24.1-py3-none-any.whl
  • Upload date:
  • Size: 19.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.12.2 Windows/11

File hashes

Hashes for ticktick_py_v2-0.24.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1a92bdf640f4d068842111ce5e5766e230409a467e441c7e51a90e4ce2f2fb4d
MD5 447e569e50279934f5bf365f3ed8acb3
BLAKE2b-256 8bc783d519409516125acda93726fcc598cc7b107250b3ae7117b716828d28a4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page