Skip to main content
The package is standard-library only (Python 3.9+); numpy is optional (Field.to_numpy()).

The smallest complete solve

Errors

Every failure is an EddyError with .code (the API’s error code — NOT_FOUND, INVALID_GEOMETRY, UNAUTHORIZED, …), .message and .status (the HTTP status; 0 when the failure was on the client: TRANSPORT, TIMEOUT).

Async jobs

A solve above the engine’s synchronous threshold (or sent with mode="async") answers 202 with a job handle. By default the client follows it and returns the result; pass _wait=False to get the handle back, then eddy.wait_for_job(job) or for event, status in eddy.job_events(job["job_id"]): ... (the server-sent events, phase then result).

Blobs and fields

Fields are content-addressed blobs. eddy.blob(blob_id) fetches bytes through a local cache (EDDY_CACHE_DIR, default ~/.cache/eddy-solve/blobs; a blob id names its bytes forever, so the cache never expires — pass cache_dir=False to disable it). eddy.field(result, "displacement") decodes one into a Field (components, count, values as array('d'), tuples(), max_magnitude(), to_numpy()); eddy.fields(result) decodes them all.

In-process (eddy-native)

pip install eddy-native adds eddy_native.Engine — the engine’s rigid-body simulation compiled, stepped and rolled out inside your process, byte-identical to /v1/sim.compile / sim.rollout / sim.step (it serialises the very structs the routes serialise) over a content-addressed store in memory or under a directory. Eddy(base_url, native=eddy_native.Engine()) routes those operations and the blobs they name in-process and everything else over HTTP — one API, one argument to switch transports; SimEnv(scene, client=that) runs with no socket. Wheels are built with maturin from bindings/eddy-native.

Retries

retries=3 by default with exponential backoff. Content-addressed operations (a reply carrying result_id, blob_id or cached) and every GET are retried on any transport failure or 502 / 503 / 504; every other POST is retried only when the engine was not reached at all (connection refused, 503). A 429 is retried only when it carries retry-after (a rate limit), after the wait it names; one without (RESOURCE_LIMIT, SESSION_LIMIT) raises at once. Once the retries are spent a 429 / 503 raises with .retry_after — the seconds the engine asked for.

Webhooks

An async solve can carry a webhook: when the job finishes the engine POSTs the finished job record to url with x-eddy-signature: blake3=<hex> (a keyed BLAKE3 MAC over the body, the key derived from secret), x-eddy-job and x-eddy-event (done or error), three attempts with backoff; the delivery log is on the job record (eddy.get_job(id)["webhook"]). A sync solve answers inline and carries none.
Verify a delivery with the same MAC: blake3.blake3(body, key=blake3.blake3(secret, derive_key_context="eddy webhook v1").digest()).hexdigest() (the blake3 package).

Usage

eddy.usage() is the caller’s own meter — the events recorded under the presented API key, newest first, with the summed cost (GET /v1/usage; the admin’s /admin/usage lists every key).

Offline mode

With the engine as a library (eddy_native.Library), Eddy(native=Library(dir), sync_to=fleet_url, journal=path) runs every operation in-process and journals each content-addressed solve it answers (not the reads, not the cache hits); eddy.sync() replays the journal to the fleet — content addressing makes every replay a cache hit or an identical solve, so the fleet answers the very result_id the offline engine answered, and the journal is idempotent. The report names each entry’s offline and fleet ids; a failed replay stays in the journal for the next sync.
The conventions for one key per tenant are on the tenancy page.

The idiomatic layers

Beside the generated client, one module per domain wraps its routes in the idiom its users already know, every one a thin class over the same Eddy (pass client= to share one, or base_url / api_key as before): eddy_solve.sim — SimEnv, the Gymnasium-shaped environment (reset() / step() 5-tuple, .gymnasium()), cartpole_scene(); eddy_solve.cad — CadEnv, the recipe-editing environment with its feature and goal helpers; eddy_solve.fea — FeaClient over the study document (vocabulary, validate, lower, edit, episode, sessions); eddy_solve.cfd — CfdClient and the Fluent-shaped CaseDocument / SettingsProxy (case.settings.setup.models.viscous.model = ...); eddy_solve.em — EmClient (the transmission lines, cavities, driven and low-frequency solves, the design document, Touchstone); eddy_solve.eda — EdaClient (the filter / query language, DRC / ERC, the board document); eddy_solve.optics — OpticsClient and OpticalSystem in the ZOS-API idiom (cooke_triplet(), lens files in and out, optimise, tolerance); eddy_solve.design — DesignClient and DesignLoop (the agentic design loop with a scripted or Claude proposer); eddy_solve.motion — MotionClient and the MotionStudy builder in the Motion Manager’s idiom (elements on mates, solve sync or as a job, series, equilibrium / linearize / sweep, a URDF robot as a study). Each layer raises its own error class (SimEnvError, FeaError, …), an EddyError subclass.

Quickstarts by domain

Reference

One method per operation, named snake_case of the operation id — the API reference names each. Path parameters are positional, query parameters keyword; a JSON body is the first positional argument (a dictionary) and every documented property is also a keyword argument (eddy.solve_structural(geometry=..., material=...)); **extra passes undocumented keys through unchanged.