Skip to main content

Python runtime for rspyts: pydantic contracts and a ctypes loader for Rust cdylibs bridged with the rspyts ABI.

Project description

rspyts (Python runtime)

The Python runtime for rspyts: define types, functions, and classes once in Rust, and rspyts generate emits a typed Python package — pydantic v2 models, exception hierarchies, handle classes — that calls the compiled Rust cdylib through a small C ABI.

This package is what that generated code imports: the Contract pydantic base, the BridgeError exception family, and the Library loader/caller. It contains no generated code, and is useful on its own only as a dependency of generated packages.

Python 3.11 through 3.14 is supported.

Installing

pip install rspyts

Note that numpy and pydantic v2 are the only dependencies, and that the package is pure Python — there is no compiled extension module.

Public API

  • Contract is the unknown-field-rejecting pydantic base used by generated models.
  • Library locates and calls the Rust cdylib.
  • BridgeError, RspytsPanicError, and StaleHandleError are the runtime exception hierarchy.
  • BridgeErrorRegistry is the call-scoped error map used by generated wrappers; register_error remains an optional process-wide fallback for handwritten code.
  • I64/U64 and their *_to_wire/*_from_wire helpers preserve exact 64-bit values as Python int while generated code uses canonical decimal strings on the wire.
  • JsonValue and the JSON helpers preserve schemaless values without confusing attachment-shaped user objects with protocol markers.

Applications normally import their generated package rather than calling Library directly.

Documentation

Documentation can be found in the repository: the Python guide, and the normative specs under docs/design.

License

This project is licensed under the MIT license.

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

rspyts-0.2.0.tar.gz (22.2 kB view details)

Uploaded Source

Built Distribution

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

rspyts-0.2.0-py3-none-any.whl (14.5 kB view details)

Uploaded Python 3

File details

Details for the file rspyts-0.2.0.tar.gz.

File metadata

  • Download URL: rspyts-0.2.0.tar.gz
  • Upload date:
  • Size: 22.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for rspyts-0.2.0.tar.gz
Algorithm Hash digest
SHA256 2f61dc242b621cc007ed0fa89e5eb420a010c3500e6fe9294fa506d72284c707
MD5 a9a0fd07f97200cd69e2c9bec396db92
BLAKE2b-256 c5e007cd2088574ef5d5d52455c076fd3811044de2ccf9d1e399eabc90ca9204

See more details on using hashes here.

Provenance

The following attestation bundles were made for rspyts-0.2.0.tar.gz:

Publisher: deploy.yml on 2xf-org/rspyts

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

File details

Details for the file rspyts-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: rspyts-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 14.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for rspyts-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a2b03d0695ccd6f15d49beaeca1ffe814efbb65c14d4d8e5a3c7e99a6c259a54
MD5 2d54e2c3d6c6bfd94cd7bfbdc8dcf72b
BLAKE2b-256 f5d0ab154bfe0f8dee6d77065e5c6a92144d0bab53f51c3c25970827619cf550

See more details on using hashes here.

Provenance

The following attestation bundles were made for rspyts-0.2.0-py3-none-any.whl:

Publisher: deploy.yml on 2xf-org/rspyts

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