todo2code Python SDK
Paczka udostępnia dwa tryby:
T2CClient/Todo2CodeClient— klient uruchomionego serwera A2A/REST;TypeScriptRuntime— lokalny most Python → Node.js, wykonujący kanoniczny runtime TypeScript bez uruchamiania serwera.
Instalacja lokalna:
python3 -m pip install .
Użycie:
import json
from todo2code_sdk import Todo2CodeClient
client = Todo2CodeClient("http://localhost:8787")
print(client.health())
result = client.diff_graph_files(".intent/run-a/intent.graph.json", ".intent/run-b/intent.graph.json")
print(result["diff"]["summary"])
files = client.diff_text_files("before.ts", "after.ts", include_html=True)
git = client.diff_git(revision="HEAD", include_svg=False)
with open(".intent/run-b/intent.graph.json", encoding="utf-8") as graph_file:
after_graph = json.load(graph_file)
reality = client.reality(after_graph, gaps_only=True)
SDK korzysta wyłącznie z biblioteki standardowej Python i opcjonalnego Bearer tokenu. Metody grafowego diffu używają REST, natomiast diff plików/Git, reality i ogólne run korzystają z A2A v1.0.
Lokalny runtime TypeScript
Najpierw zbuduj TypeScript i paczkę Python:
npm run build
make python-wheel
python3 -m pip install .intent-packages/python/todo2code-*.whl
Kanoniczny manifest Python znajduje się w katalogu głównym repozytorium. Dystrybucję wheel i sdist do publikacji zbudujesz poleceniem:
python3 -m build
python3 -m twine check dist/todo2code-*
python3 -m build dopisuje archiwa Python do współdzielonego dist/ i nie
usuwa istniejącego wyniku kompilacji TypeScript. Paczka zawiera wyłącznie
todo2code, moduł zgodności todo2code_sdk i metadane dystrybucji.
Następnie Python może uruchomić ten sam pipeline i Intent vs Reality bez
transportu HTTP:
from todo2code import TypeScriptRuntime
runtime = TypeScriptRuntime("/path/to/repository")
run = runtime.pipeline(documentation_llm=False, output_dir=".intent-python")
reality = runtime.reality(
run["graphPath"],
diagnostics_path=run["diagnosticsPath"],
gaps_only=True,
)
print(reality["view"]["totals"])
TypeScriptRuntime.pipeline() domyślnie ustawia deterministyczne NL i Markdown
oraz summary_llm=False, więc nawet obecność klucza w .env nie uruchamia
OpenRouter. Wywołania LLM wymagają jawnego ustawienia odpowiednich parametrów.
Wymagany jest Node.js oraz dostępny skompilowany dist/src/cli.js albo
wykonywalny t2c. Dla instalacji poza repo ustaw T2C_TYPESCRIPT_CLI na
bezwzględną ścieżkę CLI. Paczka Python nie replikuje logiki DSL — proces Node.js
pozostaje jedynym źródłem semantyki.
Metadata
Release files for todo2code 0.5.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| todo2code-0.5.2.tar.gz | 33.5 kB | Without provenance | Details for todo2code-0.5.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| todo2code-0.5.2-py3-none-any.whl | Python 3 | none | any | Details for todo2code-0.5.2-py3-none-any.whl |
Total release size: 49.5 kB
Release files / todo2code-0.5.2.tar.gz
| Download URL | todo2code-0.5.2.tar.gz |
|---|---|
| Size | 33.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
484bc77e273d0e703280db41ad96985244e1331363292d1e42029fb1ee5afd27
|
|
BLAKE2b-256 checksum How to use checksums |
8c41ee602ad7d476357d41a883b6bff424264bf716b6d5dc88f75838ba897e0d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.7
|
Release files / todo2code-0.5.2-py3-none-any.whl
| Download URL | todo2code-0.5.2-py3-none-any.whl |
|---|---|
| Size | 16.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
76163264c413d51ee5c9ccdeb3f3d18d0411be0fe024b1ce617c53c49daa26d2
|
|
BLAKE2b-256 checksum How to use checksums |
7e7faa761dc9f9496a60e4280c123107d8d88249e1aaf9af00796dafc0ba0cd7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.7
|
Security for todo2code 0.5.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.