Skip to main content

Rhodochrosite

Rhodochrosite is a Python 3.13+ library for loading and saving objects in the Ruby marshal format.

Support and limitations

Rhodochrosite supports nearly every feature of the Marshal library, up to Ruby 4.0. Some parts are not supported:

  • The writer never outputs object links, so both self-referential structures and identity equality are broken. Outputting object links will likely never be supported (reading them is supported)
  • Ruby strings with custom encodings are not supported; any string that does not mark itself as UTF-8 will be treated as a bytestring.
  • The "d" type (Data) will never be supported, as it related to native Ruby extensions which don't really make sense across the wire barrier

Some features may be supported in the future, but are not currently supported:

  • Regular expression types; Ruby uses a different regexp execution engine to Python so these would not be very useful beyond being opaque types.
  • Hashes with default values,
  • Module references.
  • Struct instances.

However, some esoteric features that are otherwise annoying to support are supported:

  • Strings, arrays, and hashes with custom instance variables.
  • Hashes with duplicate keys (requires passing return_native_dicts=False)
  • Unicode symbol names

Basic usage

Use read_object to turn a marshal stream into a single high-level Python object:

print(read_object(b'\x04\b"\babc'))  # => "abc"

Use write_object to turn a Python object into a marshal stream:

print(write_object([1, 2, 3]))  # => b"\x04\b[\bi\x06i\ai\b"

Object mapping

This also comes with a recursive object mapper for turning Ruby user objects into Python objects (and back again).


Metadata

Release files for rhodochrosite 26.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rhodochrosite 26.0.1
File Size Uploaded Provenance Actions
rhodochrosite-26.0.1.tar.gz 38.0 kB Without provenance Details for rhodochrosite-26.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for rhodochrosite 26.0.1
File Interpreter ABI Platform Actions
rhodochrosite-26.0.1-py3-none-any.whl Python 3 none any Details for rhodochrosite-26.0.1-py3-none-any.whl

Total release size: 90.5 kB

Release files / rhodochrosite-26.0.1.tar.gz

Download URL rhodochrosite-26.0.1.tar.gz
Size 38.0 kB
Tags Source
SHA-256 checksum
How to use checksums
88c84bca76274ffee3a654cd56ab231c0932277ae8f89c7e95d65930c39e2696
BLAKE2b-256 checksum
How to use checksums
932cc70d5bd16f77e90532bb5b3f7b20e02b612b4df7a00254ed751df72655b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.8 {"installer":{"name":"uv","version":"0.12.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Gentoo","version":"2.18","id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / rhodochrosite-26.0.1-py3-none-any.whl

Download URL rhodochrosite-26.0.1-py3-none-any.whl
Size 52.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b21106f4d234b923c7287306bc3ffae3e83bfe59cb5c2eaf7ecfd8be8bb0661d
BLAKE2b-256 checksum
How to use checksums
4eb799e3cd9e6a0a6b016df39bbdcab132b3449316f82c09ac14a22e02e50fc0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.8 {"installer":{"name":"uv","version":"0.12.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Gentoo","version":"2.18","id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for rhodochrosite 26.0.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page