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


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.1.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.1-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

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

Hashes for kerf_sdk-0.1.1.tar.gz
Algorithm Hash digest
SHA256 aed0181a784ea2b45c99951763c3b1a3e6ae81b5747372c3091e0b7a2c8c2ad8
MD5 ee3efcc1f83d7db1e4ff90cb0bcd185e
BLAKE2b-256 af28fdf5a9265fc32f9e791a8761b9cc826d3ce24d21bebcfb57956773ea49e6

See more details on using hashes here.

Provenance

The following attestation bundles were made for kerf_sdk-0.1.1.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.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

Hashes for kerf_sdk-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cfc7fc6fc550c16476f66e1097c61e8f47c934a3b87f8902d390849e33885bd4
MD5 98884a51905875659db55f7a5814805a
BLAKE2b-256 247399196ff33375886d67b12240d48cef7dcf81f28c63a918d73e13422ff569

See more details on using hashes here.

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

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