Trace Python SDK — programmatic client for the Trace AI EDA backend.
Project description
buildwithtrace-sdk
What's new in v0.1.6
Full history: release notes.
Python SDK for Trace — programmatic access to the Trace AI EDA backend (symbol/footprint generation, semantic component search, and chat/agent over your KiCad designs).
pip install buildwithtrace-sdk
from buildwithtrace_sdk import Trace
# Sign in once via the browser (opens the Trace login page, supports
# password + Google + GitHub + magic link, and solves the captcha there):
client = Trace.login() # stores credentials, returns a ready client
# ...after which a bare Trace() "just works" by reading those credentials:
client = Trace() # or Trace(api_key="...") / TRACE_API_KEY env var
sym = client.generate_symbol("LM7805 5V voltage regulator")
sym.save("./symbols/") # writes LM7805.kicad_sym
fp = client.generate_footprint("SOIC-8 3.9x4.9mm")
fp.save("./footprints/") # writes SOIC-8.kicad_mod
for r in client.search("3.3V LDO", type="symbol", limit=5):
print(r.name, r.library)
# Read-only Q&A about a design:
ans = client.ask("What ERC violations exist?", project_dir="./my-board/")
print(ans.text)
# Agent mode — the SDK runs the client-side tool loop locally (sandboxed):
res = client.chat("Add a 100nF decoupling cap on VCC", mode="agent", project_dir="./my-board/")
print(res.text)
Auth options:
Trace.login()— browser deeplink sign-in; persists credentials so laterTrace()calls (and thebuildwithtraceCLI) reuse them.Trace.logout()clears them.buildwithtrace auth login(CLI) — same browser flow.Trace(api_key="...")/TRACE_API_KEY/TRACE_API_TOKENenv — explicit token (CI/headless).- Get a token (CI): mint a long-lived Personal Access Token with
buildwithtrace auth token --create --name ci-bot(trace_pat_..., shown once), or in the dashboard (Settings → Developer). Token management requires an interactive login — a PAT can't mint/revoke tokens.
Env overrides: TRACE_BASE_URL (API base), TRACE_FRONTEND_URL (login page origin),
TRACE_API_KEY / TRACE_API_TOKEN (token), TRACE_API_VERSION (default latest),
TRACE_LLM_PROVIDER / TRACE_LLM_API_KEY / TRACE_LLM_MODEL (BYOK),
TRACE_NO_ANALYTICS / DO_NOT_TRACK (opt out of anonymous usage analytics).
Notes
chat(mode="agent")/"plan"produce file-editing tool calls. The SDK runs a standalone, client-side tool-execution loop: when you passproject_dir, file ops (read/write/search_replace/list_dir/grep/delete) and local ERC/DRC/export run on your machine with the SAME safety as the desktop/CLI (extension allowlist, project-dir sandbox, symlink-safe path resolution), looping until the turn completes. Writes are auto-approved (programmatic agent). Without aproject_dir, an emitted tool call raisesTraceToolExecutionError(file ops can't be sandboxed); GUI-only tools (canvas snapshots, layer toggles) are always reported as unsupported..trace_sch/.trace_pcbwrites are converted to KiCad format via thebuildwithtrace-converterpackage (a hard dependency); if the conversion raises the file is still written and the turn continues (conversion is reported as failed, not fatal).- BYOK via
chat(..., llm_provider=, llm_api_key=, llm_model_id=)or theTRACE_LLM_PROVIDER/TRACE_LLM_API_KEY/TRACE_LLM_MODELenv, or the CLI's persistedbyok setstore (precedence: per-call args > env > store). BYOK skips Trace's cost cap but NOT the plan gate —agent/planstill need a paid plan or free agent credits even with your own key (askis free); a free account gets aTracePlanRestrictedError. - Anonymous, privacy-first usage analytics (method names, durations, outcomes — never file
contents/paths/prompts). Auto-off in CI; opt out with
TRACE_NO_ANALYTICS=1/DO_NOT_TRACK=1.
Extracted from the buildwithtrace CLI repo. The CLI re-exports Trace for
backward compatibility (from buildwithtrace import Trace).
Project details
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 buildwithtrace_sdk-0.1.6.tar.gz.
File metadata
- Download URL: buildwithtrace_sdk-0.1.6.tar.gz
- Upload date:
- Size: 96.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c59cbe783f24ba7b51bdea6b0b4c600e3dab7e9e816f1c689b2515d3c321c43b
|
|
| MD5 |
e26c2041f4d781929c0122e14b687e16
|
|
| BLAKE2b-256 |
81967287ec5013e6b6b9557cb6e848c7d486494aecdd3ba27c944aa930466d06
|
Provenance
The following attestation bundles were made for buildwithtrace_sdk-0.1.6.tar.gz:
Publisher:
release.yml on elcruzo/trace-sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
buildwithtrace_sdk-0.1.6.tar.gz -
Subject digest:
c59cbe783f24ba7b51bdea6b0b4c600e3dab7e9e816f1c689b2515d3c321c43b - Sigstore transparency entry: 1811604005
- Sigstore integration time:
-
Permalink:
elcruzo/trace-sdk-python@c875739d3674f2afa61e1aa0eceed37fa2f16a4c -
Branch / Tag:
refs/tags/v0.1.6 - Owner: https://github.com/elcruzo
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c875739d3674f2afa61e1aa0eceed37fa2f16a4c -
Trigger Event:
push
-
Statement type:
File details
Details for the file buildwithtrace_sdk-0.1.6-py3-none-any.whl.
File metadata
- Download URL: buildwithtrace_sdk-0.1.6-py3-none-any.whl
- Upload date:
- Size: 67.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc4b9ddcf9c7ed6a4c88187f1edf92b947f27fe133f5c9448ac60d30804c1993
|
|
| MD5 |
ab2e0c08051ca71adf6350fc636cbc05
|
|
| BLAKE2b-256 |
7718fc5c3557d49d81ce98541ea492b9132b6a1b374b3585db9302cb68220558
|
Provenance
The following attestation bundles were made for buildwithtrace_sdk-0.1.6-py3-none-any.whl:
Publisher:
release.yml on elcruzo/trace-sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
buildwithtrace_sdk-0.1.6-py3-none-any.whl -
Subject digest:
dc4b9ddcf9c7ed6a4c88187f1edf92b947f27fe133f5c9448ac60d30804c1993 - Sigstore transparency entry: 1811604328
- Sigstore integration time:
-
Permalink:
elcruzo/trace-sdk-python@c875739d3674f2afa61e1aa0eceed37fa2f16a4c -
Branch / Tag:
refs/tags/v0.1.6 - Owner: https://github.com/elcruzo
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c875739d3674f2afa61e1aa0eceed37fa2f16a4c -
Trigger Event:
push
-
Statement type: