Official Python SDK for the Lithora REST API (teams, projects, tasks, work graph, AI workspace).
Project description
lithora
Official Python SDK for the Lithora REST API — teams, projects, tasks, the unified work graph, and the confirmation-gated AI workspace.
- Base URL:
https://api.lithora.io(local dev:http://localhost:8000) - Auth: JWT bearer (HS256). Get a token with
client.login(...).
Install
pip install lithora
# or, from this source tree:
pip install -e /path/to/sdk/python
Requires Python 3.9+ and requests>=2.28.
Quickstart
from lithora import Lithora, AuthChallengeError
client = Lithora(base_url="https://api.lithora.io") # or http://localhost:8000
# 1. Authenticate. Token is stored on the client and reused automatically.
try:
user = client.login("you@example.com", "your-strong-password")
except AuthChallengeError as e:
# Login asked for a second factor instead of returning a token.
print("2FA:", e.requires_2fa, " OTP:", e.requires_login_otp)
raise
# 2. Create a project (needs a team_id; list teams with client.teams.list()).
project = client.projects.create("Apollo", team_id="team_123",
description="Q3 launch", status="active")
# 3. Create a task in that project.
task = client.tasks.create("Write the spec", project_id=project["id"],
priority="high", status="todo")
client.tasks.set_status(task["id"], "in_progress")
# 4. Use the AI workspace (confirmation-gated agent over the work graph).
session = client.ai.create_session(title="Planning")
reply = client.ai.chat(session["session_id"], "Break the spec into subtasks")
if reply.get("requires_confirmation"):
action = reply["action_plan"]["actions"][0] # shape per server
client.ai.confirm_action(session["session_id"], action["id"], confirmed=True)
Already have a token? Skip login: Lithora(token="eyJ...").
API surface
All methods map 1:1 to verified endpoints. Namespaces on the client:
| Namespace | Methods |
|---|---|
client (auth) |
login, register, set_token |
client.auth |
me |
client.teams |
list, get, create, members |
client.projects |
list, get, create, update, patch, delete |
client.tasks |
list(project_id), my, get, create, update, set_status, delete, bulk, link_github, push_to_github |
client.work_items |
list, get, create, update, delete, create_relation, relations, children, parents, delete_relation, cycle_time |
client.ai |
create_session, chat, link_item, search, confirm_action |
Errors
Every non-2xx response raises a typed exception (all subclass LithoraError):
| Exception | When |
|---|---|
AuthError |
401 — missing/invalid/expired token |
ServerError |
5xx — failure on Lithora's side |
ApiError |
any other non-2xx; has .status and .detail |
AuthChallengeError |
login needs a 2FA/OTP code (no token issued); has .requires_2fa, .requires_login_otp |
from lithora import ApiError
try:
client.projects.get("does-not-exist")
except ApiError as e:
print(e.status, e.detail) # e.g. 404 "Project not found"
Known gaps
- No API-key / PAT auth. Lithora only supports JWT bearer tokens today,
so this SDK authenticates via
login(email, password). There is no long-lived key mechanism to wrap. - Some endpoints (
tasks.link_github,tasks.push_to_github,work_items.create) accept fields the public contract abbreviates; those methods pass extra keyword arguments straight through to the request body. work_items.cycle_timetargets a newly added analytics endpoint; its response shape is provisional and fields may change. It requires ateam_idorproject_idyou have access to.
License
MIT — see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lithora-0.1.0.tar.gz.
File metadata
- Download URL: lithora-0.1.0.tar.gz
- Upload date:
- Size: 14.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
420f70dfbcc6f59573452dfd8e596cc46300ebaedcc21b8093456bc4ebae3508
|
|
| MD5 |
8bac18a348524dfd355050e05b7621ef
|
|
| BLAKE2b-256 |
97cdf010543aaebcd174385ea986694a97096d13df919e70a8b6b19347a4f680
|
File details
Details for the file lithora-0.1.0-py3-none-any.whl.
File metadata
- Download URL: lithora-0.1.0-py3-none-any.whl
- Upload date:
- Size: 13.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7f4e8cc289cf42aff70090e5bed6f763df30dd15db4492211f4c72612384ee3c
|
|
| MD5 |
58a13d7f361d8fef0e9c0d63433005f2
|
|
| BLAKE2b-256 |
dce8afc40727faf1371fbebf1b4c9a0062f4502a33003e069b03a2b01d342d6b
|