Skip to main content
The ticket-py package provides native Python bindings to ticket-rs, giving you full access to issue management and graph analytics from Python code. Every visible tk subcommand has a typed Python wrapper, generated from the same clap::Command tree the binary parses against — so the Python surface stays in lockstep with the CLI by construction. Calls go through an in-process PyO3 FFI; no subprocess is spawned.

Installation

Activating the Environment

If you used the installer script, activate the environment:
Or run directly without activation:

Quick Start


API Reference

ticket_py exposes three categories of API:
  1. 76 typed wrappers — one per visible tk subcommand. Type hints come from clap.
  2. dispatch(argv) — raw escape hatch for any command, including hidden ones.
  3. command_spec() — introspect the CLI surface as a nested dict.

Typed wrappers

Each wrapper takes the command’s flags as keyword arguments (kebab-case becomes snake_case: --dry-rundry_run), plus the global flags dir, format, json, and strict. Return value depends on format:
  • format="json" → parsed JSON (list / dict)
  • omitted or any other value → the raw stdout string
The full surface includes every visible tk command — linear_sync, github_sync, claude_sync, worktree, stacks, insights, search, similar, validate, lint, and more. Discover them at runtime:

dispatch(argv)

Raw escape hatch for any command. Same in-process PyO3 path; you build the argv yourself.

command_spec()

Introspect the CLI surface as a nested dict — useful for building meta-tools, generating other typed bindings, or discovering commands and their flags programmatically.

Error handling

Errors split into two distinct classes:

Return shapes

When you pass format="json", wrappers return parsed JSON. The shape mirrors what tk <command> --format json emits on the CLI:
For the exact shape of each command’s JSON, run tk <command> --format json once and inspect.

Examples

Find high-priority ready issues

Batch create issues

Export issues to JSON

Integration with pandas


Platform Support

Pre-built wheels are available for:
If no pre-built wheel exists for your platform/Python version, installation will build from source (requires Rust toolchain).

Environment Variables


Troubleshooting

Make sure you’ve activated the virtual environment:
Or reinstall:
In recent releases, the hand-written Ticket pyclass and the nine hand-written wrapper functions (list_issues, ready_issues, show_issue, create_issue, update_issue, search_issues, find_similar_issues, version) were replaced with a typed_api generated from the CLI’s clap surface.
See the API Reference above; or ticket_py.dispatch(["list", "-f", "json"]) for the raw escape hatch.
The package contains native Rust code. If no pre-built wheel exists for your platform, you’ll need:
  1. Rust toolchain: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  2. Python development headers
Or use the installer script which downloads pre-built wheels.
The installer auto-detects your Python version. To use a specific version:

Next Steps

MCP Server

Use ticket-mcp for AI agent integration.

CLI Reference

Full command documentation.