This release is a pre-release and may not be stable for production use.
ryucad for Python
The official Python client for ryucad,
CAD built for AI agents to drive. It runs an installed ryucad as
ryucad session --stdio, one process per connection, and sends ryucad's
requests by name: the framing, binary answers, progress and typed errors
are handled for you. Standard library only, Python 3.10 or newer,
Apache-2.0.
Install
The package finds an installed ryucad; it ships none. Install ryucad first:
curl -fsSL https://github.com/Seiraiyu/ryucad/releases/latest/download/install.sh | sh
or on Windows (PowerShell):
irm https://github.com/Seiraiyu/ryucad/releases/latest/download/install.ps1 | iex
then the package:
pip install ryucad
It looks for ryucad in connect(exe=...), then RYUCAD_EXE, then ryucad
on PATH, then the installers' ~/.ryucad/bin (RYUCAD_HOME's bin
when that is set), and raises ryucad.NotInstalled with the two commands
above when there is none. It needs ryucad's protocol 3 or newer (the one
with batch) and warns when ryucad is older than the package.
A build script
import ryucad
def plate(name, width):
return ryucad.op(
"part.ensure",
part=name,
params={"w": f"{width} mm"},
features=[{"id": "base", "type": "box", "params": {"x": "w", "y": 30, "z": 6}}],
)
with ryucad.connect("~/work/fixture") as cad:
answer = cad.batch([plate("left", 40), plate("right", 60)], prune=True)
print(answer["parts"]) # {"left": {"status": "created", ...}, ...}
again = cad.batch([plate("left", 40), plate("right", 60)], prune=True)
assert again["written"] == 0 # nothing changed, nothing written
cad.call("export", part="left", out="left.step") # relative to the project
stl = cad.call("export", part="left", format="stl")
print(len(stl.data), "bytes of STL")
cad.call(method, params=None, **params)sends any request by name and returns itsresultas a dict; an answer that carries bytes has them in.data. A param named like a Python keyword (from) goes in the dict.cad.batch(ops, expect=None, dry_run=False, rebuild=None, prune=False)runs many edits as one checked, logged, undoable change;ryucad.opbuilds each op.cad.ensure(part, features, ...)ispart.ensurealone, andcad.undo()takes back this participant's latest change.connect(folder, as_=..., no_daemon=..., exe=..., env=..., on_progress=...):as_names the participant in the activity log;on_progressreceives eachprogressline of a request sent withprogress=True; after the script's ownsubscribe, notifications collect incad.notifications.- One request at a time per session (threads take turns); open two
sessions for two at once. Ctrl+C cancels a long request and waits for its
cancelledanswer beforeKeyboardInterruptreaches the script.
Errors
A refusal raises ryucad.RyucadError with ryucad's stable code, a
message, its details, and pointer, path, op and method when it
names them (a batch's failing op). It is one of FixableError (the agent
can fix it), UsageError, ProjectError (no usable project) or
ExternalError (not the agent's fault), with named classes for the codes
scripts branch on: Conflict, NotFound, RebuildFailed,
HasDependents, AssemblyOverconstrained, Cancelled, DaemonError.
Every other code is matched by e.code == ryucad.Code.SOME_CODE. The
client's own errors are NotInstalled, Incompatible, SessionClosed and
ProtocolError; all derive from ryucad.Error.
try:
cad.batch(ops)
except ryucad.FixableError as e:
print(e.code, e.op, e.pointer, e.message)
The protocol
Methods, params and answers are ryucad's own: ryucad <command> --help
and --json name them, and the repository's
scripting notes
describe session --stdio, batch and part.ensure. The package adds no
second API.
Versions
The package is released with ryucad, from the same tag: ryucad vX.Y.Z
publishes ryucad X.Y.Z here, and a pre-release vX.Y.Z-pre.N
publishes X.Y.ZrcN (install it with pip install --pre). Keep the
package and ryucad at the same version.
Metadata
Release files for ryucad 0.9.2rc4
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 |
|---|---|---|---|---|
| ryucad-0.9.2rc4.tar.gz | 31.5 kB | With provenance | Details for ryucad-0.9.2rc4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ryucad-0.9.2rc4-py3-none-any.whl | Python 3 | none | any | Details for ryucad-0.9.2rc4-py3-none-any.whl |
Total release size: 56.4 kB
Release files / ryucad-0.9.2rc4.tar.gz
| Download URL | ryucad-0.9.2rc4.tar.gz |
|---|---|
| Size | 31.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d980a6d48373f59842529ecdfd968456fc59e4c5cac7311dfa5be0701e47858d
|
|
BLAKE2b-256 checksum How to use checksums |
682b2b52b722875d7933b94112251fb84cbabb58e3cbc653cb309f58b1513707
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.
Transparency logRelease files / ryucad-0.9.2rc4-py3-none-any.whl
| Download URL | ryucad-0.9.2rc4-py3-none-any.whl |
|---|---|
| Size | 24.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
07ce65722d36cffad3c3bc9357ea3624c401760ad1593c3ab98cc59a66c33cc6
|
|
BLAKE2b-256 checksum How to use checksums |
be2d6157f0a389b54a8a0dee5ffa6a6a1cdb00fbdcf494d1fa63e3407bdf9087
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.
Transparency logSecurity for ryucad 0.9.2rc4
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for ryucad-0.9.2rc4.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.
Transparency logA 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.