Skip to main content

rust-ok

Rust-style Result, Ok, and Err primitives for Python projects.

Installation

pip install rust-ok

Usage

from rust_ok import Result, Ok, Err

def parse_int(raw: str) -> Result[int, str]:
    try:
        return Ok(int(raw))
    except ValueError as exc:
        return Err(str(exc))

result = parse_int("42")
print(result.unwrap_or(0))  # -> 42

Formatting exception chains

from rust_ok import Err, Ok, format_exception_chain

try:
    Err(ValueError("boom")).unwrap()
except Exception as exc:
    print(format_exception_chain(exc))

Iterating over results

from rust_ok import Err, Ok, is_ok

results = [Ok(1), Err("bad"), Ok(3)]

for res in results:
    if is_ok(res):
        print("value:", res.unwrap())

Metadata

Release files for rust-ok 0.3.0

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

Source distribution (sdist)

Source distribution for rust-ok 0.3.0
File Size Uploaded Provenance
rust_ok-0.3.0.tar.gz 5.3 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for rust-ok 0.3.0
File Interpreter ABI Platform
rust_ok-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 12.6 kB

Release files / rust_ok-0.3.0.tar.gz

Download URL rust_ok-0.3.0.tar.gz
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
7d79997d87b31fa8d960180ecb3abb2c989c6294c65ffad642963baf5da21447
BLAKE2b-256 checksum
How to use checksums
d4b487573f97dfecc11158ac35e8cb57045dc8759c51b56010a1423194481cdc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Feb 3, 2026.

Transparency log

Release files / rust_ok-0.3.0-py3-none-any.whl

Download URL rust_ok-0.3.0-py3-none-any.whl
Size 7.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4b1635c0623c1a3a3f039a739fd47271bcdb4b5f4fc4fc833e70d197708d65c5
BLAKE2b-256 checksum
How to use checksums
456a606fc68d1d16725915832577bf0fe62621dbb0dcc931cd5b4bade72e9099
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Feb 3, 2026.

Transparency log

Security for rust-ok 0.3.0

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

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for rust_ok-0.3.0.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 Feb 3, 2026.

Transparency log

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