Skip to main content

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.sh   # 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kerf_sdk-0.1.2.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kerf_sdk-0.1.2-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file kerf_sdk-0.1.2.tar.gz.

File metadata

  • Download URL: kerf_sdk-0.1.2.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

Hashes for kerf_sdk-0.1.2.tar.gz
Algorithm Hash digest
SHA256 27d83c7c18ddce05b3f12b3403b1321f940b6e430260bbfb7e4b911dd682d674
MD5 4091fd149f41cc789d927d14715a7c96
BLAKE2b-256 d2608eec063f92b74792f261a63ffbf7080b06651551a825fecb2928a124e781

See more details on using hashes here.

Provenance

The following attestation bundles were made for kerf_sdk-0.1.2.tar.gz:

Publisher: publish-sdk-py.yml on kerf-sh/kerf

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file kerf_sdk-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: kerf_sdk-0.1.2-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

Hashes for kerf_sdk-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c73a166ec09934d3917c7cd5844c53eede63b512d06d38652fac29d0032af25b
MD5 1cbbb2a7b5d932de118ca6c04f5113af
BLAKE2b-256 cc00694d7c0a1f280b83073825475d7a27ce520b4270144b07009a907692951b

See more details on using hashes here.

Provenance

The following attestation bundles were made for kerf_sdk-0.1.2-py3-none-any.whl:

Publisher: publish-sdk-py.yml on kerf-sh/kerf

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page