track CLI command is a thin wrapper around track.core — the same module you can import in your own Python code. Because all the business logic lives on the server, the library stays lightweight: it is pure stdlib, makes plain HTTP calls to the /api/* endpoints, and hydrates the JSON responses into typed dataclasses. You can drive it from a Jupyter notebook, a cron script, a Slack bot, or any Python automation pipeline without touching the CLI at all.
Requirements and installation
track.core requires Python 3.11 or later. The easiest way to install it is through the project’s init.sh script, which creates a virtualenv and symlinks the track binary:
track.core is importable from the same virtualenv (or from any environment where you have installed the package directly).
Configuration
The library reads credentials from the same place the CLI does — no separate setup needed if you have already runtrack config:
~/.track/config.toml— written bytrack config. Containsapi_urlandapi_key.- Environment variables —
TRACK_API_KEYandTRACK_API_URLtake precedence over the file and are useful in CI, containers, or serverless functions.
https://projects.wrixton.xyz. You only need to set TRACK_API_URL if you are pointing at a self-hosted deployment.
The Item dataclass
Every function that returns data gives you backItem instances (or lists of them). The available fields are:
| Field | Type | Description |
|---|---|---|
id | str | Unique item ID, e.g. t-1f3a, s-7bdb, g-c4a1 |
kind | str | One of todo, chore, task, gift, shopping, grocery |
title | str | The item’s display name |
status | str | todo, doing, done, or canceled |
priority | int | 1 (highest) to 5 (lowest); default 3 |
due | date | None | Effective due date |
tags | list[str] | Free-form tag list |
notes | str | None | Markdown notes body |
every | str | None | Recurrence string, e.g. "weekly", "3 months" |
last_done | date | None | For chores: when it was last completed |
project | str | None | Project slug (tasks only) |
feature | str | None | Feature ID (tasks only) |
for_person | str | None | Gift recipient name |
occasion | str | None | Gift occasion, e.g. "Birthday" |
budget | float | None | Budget in your local currency (gifts and shopping) |
url | str | None | Reference URL (gifts and shopping) |
estimate_minutes | int | None | Time estimate in minutes |
Key functions
Adding items
priority defaults to 3. Pass an every string ("weekly", "3 months", etc.) to make it recurring — on completion the server spawns the next occurrence automatically.
last_done + every. The every argument is required.
feature_id to attach it to a specific feature within that project.
for_person is required. Gifts have a two-stage lifecycle: mark_bought moves status to doing (bought, not yet given), and mark_done moves it to done (given).
s- ID prefix.
g- prefix and appear in their own list. Use tags to capture the store (e.g. tags=["costco"]).
Completing items
date as when to record a completion date other than today.
doing (bought, not yet given/used). For gifts this is the intermediate step before mark_done.
Reading data
status == "doing"). Results are sorted by priority and due date, matching the CLI’s track today output.
shopping-kind items.
Managing projects
title, status, or notes. Pass only the fields you want to change. Setting status="done" archives the project.
slug is auto-generated from the title if omitted. kind defaults to "standard"; use "engineering" to unlock features and requirements.
Example
IDs like
"s-7bdb" are prefix-matched on the server, so you can pass a shorter prefix (e.g. "s-7b") as long as it is unambiguous. A KeyError is raised if the prefix matches zero or more than one item.