Python SDK for Kerf — talk to a Kerf instance over HTTP/JSON-RPC
Project description
kerf-sdk
Python SDK for Kerf — automate your CAD/EDA projects over HTTP/JSON-RPC.
Install
pip install kerf-sdk
Auth
Generate an API token from your workspace settings (/w/<slug>/settings → API Tokens), then:
export KERF_API_TOKEN=kerf_sk_...
export KERF_API_URL=https://kerf.app # default; omit for cloud
Quickstart
import kerf
k = kerf.from_env()
# list files in a project
files = k.files.list(project_id="<uuid>")
for f in files:
print(f["name"], f["kind"])
# read a script file
content = k.files.read(project_id="<uuid>", file_id="<uuid>")
# search code across the project
results = k.files.search(project_id="<uuid>", query="extrude")
# read equations
eqs = k.equations.read(project_id="<uuid>", file_id="<uuid>")
API
All calls go through POST /v1/rpc as JSON-RPC 2.0 envelopes. The method names match Kerf's tool registry:
| Method | Description |
|---|---|
files.list |
List project files |
files.read |
Read file content |
files.write |
Overwrite file content |
files.edit |
Apply a diff-style edit |
files.create |
Create a new file |
files.delete |
Delete a file |
files.search |
Search code across files |
import_step |
Import a STEP file |
equations.read |
Read project equations |
equations.set |
Set an equation value |
configurations.add |
Add a configuration variant |
configurations.set_active |
Switch active configuration |
revisions.list |
List file revision history |
revisions.restore |
Restore a previous revision |
docs.search |
Search Kerf documentation |
Low-level access
result = k.invoke("files.list", {"project_id": "..."})
Source
Part of the Kerf monorepo. SDK lives at kerf-sdk/.
License
MIT
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 kerf_sdk-0.1.1.tar.gz.
File metadata
- Download URL: kerf_sdk-0.1.1.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aed0181a784ea2b45c99951763c3b1a3e6ae81b5747372c3091e0b7a2c8c2ad8
|
|
| MD5 |
ee3efcc1f83d7db1e4ff90cb0bcd185e
|
|
| BLAKE2b-256 |
af28fdf5a9265fc32f9e791a8761b9cc826d3ce24d21bebcfb57956773ea49e6
|
Provenance
The following attestation bundles were made for kerf_sdk-0.1.1.tar.gz:
Publisher:
publish-sdk-py.yml on kerf-sh/kerf
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kerf_sdk-0.1.1.tar.gz -
Subject digest:
aed0181a784ea2b45c99951763c3b1a3e6ae81b5747372c3091e0b7a2c8c2ad8 - Sigstore transparency entry: 1564153246
- Sigstore integration time:
-
Permalink:
kerf-sh/kerf@6b8bd4c585e57997a48a0b991c82663bb0635aed -
Branch / Tag:
refs/tags/sdk-py-v0.1.1 - Owner: https://github.com/kerf-sh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-sdk-py.yml@6b8bd4c585e57997a48a0b991c82663bb0635aed -
Trigger Event:
push
-
Statement type:
File details
Details for the file kerf_sdk-0.1.1-py3-none-any.whl.
File metadata
- Download URL: kerf_sdk-0.1.1-py3-none-any.whl
- Upload date:
- Size: 6.2 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 |
cfc7fc6fc550c16476f66e1097c61e8f47c934a3b87f8902d390849e33885bd4
|
|
| MD5 |
98884a51905875659db55f7a5814805a
|
|
| BLAKE2b-256 |
247399196ff33375886d67b12240d48cef7dcf81f28c63a918d73e13422ff569
|
Provenance
The following attestation bundles were made for kerf_sdk-0.1.1-py3-none-any.whl:
Publisher:
publish-sdk-py.yml on kerf-sh/kerf
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kerf_sdk-0.1.1-py3-none-any.whl -
Subject digest:
cfc7fc6fc550c16476f66e1097c61e8f47c934a3b87f8902d390849e33885bd4 - Sigstore transparency entry: 1564153296
- Sigstore integration time:
-
Permalink:
kerf-sh/kerf@6b8bd4c585e57997a48a0b991c82663bb0635aed -
Branch / Tag:
refs/tags/sdk-py-v0.1.1 - Owner: https://github.com/kerf-sh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-sdk-py.yml@6b8bd4c585e57997a48a0b991c82663bb0635aed -
Trigger Event:
push
-
Statement type: