Standalone Python SDK for the ForkTex Network platform — identity, projects, tasks, worklogs, channels
Project description
forktex-network
Standalone async Python SDK for the ForkTex Network platform.
forktex-network is the typed Python client for the Network operations platform — identity, multi-tenancy,
org and personal projects, tasks, work logs, and activity feeds. Every OpenAPI operation (~65 endpoints)
is exposed as a typed async method on NetworkClient, and every request/response schema is available as a
Pydantic model re-exported at the package root.
Install
pip install forktex-network
Requires Python 3.12+. Tested on 3.12, 3.13, 3.14.
Quick Start
Human auth
from forktex_network import NetworkClient
async with NetworkClient(base_url="https://network.forktex.com") as client:
token = await client.login("user@example.com", "password")
me = await client.identity_me()
orgs = await client.tenancy_list_orgs()
Service or agent auth
from forktex_network import AuthType, NetworkClient
async with NetworkClient(
base_url="https://network.forktex.com",
api_key="ftx-...",
auth_type=AuthType.SERVICE,
) as client:
health = await client.health()
async with NetworkClient(
base_url="https://network.forktex.com",
api_key="ftx-...",
auth_type=AuthType.AGENT,
agent_id="forktex-automation",
) as client:
feed = await client.feed_activity()
Projects and tasks
from forktex_network import NetworkClient, ProjectsSearchSpec, TasksPageSearchSpec, TaskCreate
async with NetworkClient(base_url="http://localhost:9000") as client:
await client.login("user@example.com", "password")
orgs = await client.tenancy_list_orgs()
org_id = orgs[0].id
projects = await client.projects_search_org(
org_id=org_id,
body=ProjectsSearchSpec(page=1, page_size=10),
)
first_project = projects.data[0]
tasks = await client.tasks_search(
project_id=first_project.id,
body=TasksPageSearchSpec(page=1, page_size=20),
)
new_task = await client.tasks_create(
body=TaskCreate(
project_id=first_project.id,
name="Write tests",
status_id=1,
priority_id=1,
)
)
Method naming
Method names match the operationId of each OpenAPI operation, with the FastAPI-appended
_api_<path>_<method> tail stripped. A few examples:
OpenAPI operationId |
Python method |
|---|---|
health_api_health_get |
client.health() |
identity_me_api_identity_me_get |
client.identity_me() |
tasks_search_api_tasks_project__project_id__search_page_post |
client.tasks_search(...) |
projects_search_org_api_projects_org__org_id__search_post |
client.projects_search_org(...) |
A handful of convenience wrappers are added on top for common flows:
client.login(email, password)— callsidentity_loginand captures the returned JWT.client.register(email, password)— callsidentity_register_accountand captures the JWT.client.me()— alias ofidentity_me.client.close()/async with— lifecycle.
What's in the package
forktex_network.NetworkClient— async client. Inherits ~65 generated methods from_GeneratedOperationsplus the auth/session patch layer.forktex_network.client.generated— OpenAPI-derived Pydantic models,_GeneratedOperations,SPEC_VERSION, andSPEC_HASH.forktex_network.auth—AuthTypeand credential/header handling.
All generated models are re-exported at the top level:
from forktex_network import (
NetworkClient, NetworkAPIError, AuthType, Credentials,
SPEC_VERSION, SPEC_HASH,
HealthResponse, OrgRead, Task, TaskCreate, TaskDetail,
ProjectsSearchSpec, TasksPageSearchSpec, WorkLogsSearchSpec,
# ... every generated model
)
MCP
The ForkTex Network backend also exposes an MCP (Model Context Protocol) surface at /api/mcp, mounted via
fastapi-mcp. It projects every FastAPI route as an MCP tool at runtime — no separate SDK path needed.
Agent hosts (Claude Desktop, Cursor, the Python/JS MCP clients, future ForkTex frontoffice/backoffice agents)
connect to /api/mcp directly. This SDK is not involved in the MCP transport; it remains the Python
programmatic client over REST.
Discoverability stub: GET /api/mcp/info returns protocol, version, endpoint, and spec link.
Codegen
make codegen at the repo root does three things:
- Exports the canonical
openapi.jsonfrom the API. - Regenerates Python, JS, and TypeScript bundles into
api/codegen/build/. - Distributes those bundles into
sdk-py/src/forktex_network/client/generated/,sdk-js/src/generated/, andclient/src/api/.
The TypeScript toolchain is pinned by api/codegen/package.json and api/codegen/pnpm-lock.yaml.
Versioning
The SDK follows SemVer. Generated models include SPEC_VERSION and SPEC_HASH so consumers can inspect
which API schema was used for the current release.
Repository
This SDK lives inside the forktex/network monorepo alongside the FastAPI API server, the Expo client, and
the JS SDK (sdk-js/, @forktex/network). The package is independently buildable and publishable.
Development
The Makefile is generated by forktex fsd makefile sync from forktex.json — do not hand-edit.
make help # list every available target
make deps # editable install with the dev group
make format # ruff format
make lint # ruff check
make test # pytest tests/
make codegen-check # verify the generated client imports cleanly
make build # python3 -m build → dist/
make ci # format-check + lint + license-check + audit + test + build
make clean # remove caches and dist/
make ci is the single command that gates a publish: format-check, lint, dual-license header check, dependency CVE audit, full test suite, and python -m build + twine check.
License headers
Every source file carries the AGPL-3.0 + Commercial dual-license SPDX header, applied idempotently via:
make license-check # CI gate — fails if any source file is missing the header
make license-fix # add or refresh headers across src/, tests/, scripts/
make license-strip # remove headers (used before license-model changes)
License
Dual-licensed — AGPL-3.0-or-later for open-source use, commercial for everything else (proprietary products, SaaS without source release, redistribution in closed-source form). See LICENSE and NOTICE for the full terms.
Commercial licensing inquiries: info@forktex.com.
The 1.0.0 release on PyPI was AGPLv3-only; from 0.2.3 onwards the package adds an explicit commercial-license carve-out (LicenseRef-ForkTex-Commercial) for proprietary use.
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 forktex_network-0.2.3.tar.gz.
File metadata
- Download URL: forktex_network-0.2.3.tar.gz
- Upload date:
- Size: 21.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
abd8bc356d372509ffb2dcbdf279540f884d097c129e9cf55c8eb4800c8932bf
|
|
| MD5 |
4722bdbb59e88a4b090c70902b2940f5
|
|
| BLAKE2b-256 |
5df8bfae55207c5ed25b5b25662bb320c1fa0bf138506e0e11036bf2a0b28692
|
File details
Details for the file forktex_network-0.2.3-py3-none-any.whl.
File metadata
- Download URL: forktex_network-0.2.3-py3-none-any.whl
- Upload date:
- Size: 24.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
50a6cdbb11a8a83813ec65d55cbcb7db1446f48715448deb607af29fa79c09bb
|
|
| MD5 |
8fcd4ba1c5f294fb4352a211f5ba4aac
|
|
| BLAKE2b-256 |
e3e70f68d5d1ee4b80d9b4343c17c557e511fc55704c85f78d781e4e663349b1
|