Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

updated: 2026-04-10T17:26:56.213031846-07:00[America/Los_Angeles]


README

ry

PyPI PyPI - Python Version PyPI - Wheel PyPI - Downloads PyPI - Status PyPI - License

python bindings for rust crates ~ ry == rust | python

DOCS: ryo3.dev (WIP)

API: ryo3.dev/api

This is a work in progress ~ feedback and PRs are welcome.

Highlights

  • Async/Blocking http-clients: Built on reqwest, with a fetch-like API. Supports streaming, zero-copy IO (via the buffer protocol), timeouts, redirect-following, and native JSON (de)serialization.
  • WebSocket client: Built on tokio-websockets and styled after jawascript’s WebSocket API.
  • jiff based datetime library: comprehensive datetime library based on jiff (pydantic-compatible).
  • Async file I/O: AsyncFile API similar to aiofiles and anyio’s async-file api.
  • (de)compression: (de)compression support for zstd, brotli, gzip, and bzip2.
  • hashing: aws-lc-rs, fnv, and twox-hash (aka xxhash)
  • Ergonomic: APIs designed to be ergonomic and pythonic and familiar to both python and rust users.
  • Type Annotated: All public APIs are (painstakingly) type annotated and checked.
  • Performant: Speed without the words “blazingly fast.” 1
  • Pydantic Integration: ry data types (mostly) work good w/ pydantic.
  • Not slop: Artisanal, hand-crafted, grassfed, fair-trade, small-batch software.
  • No emojis
  • MANY crate bindings see below.

Install

pip install ry
uv add ry
uv pip install ry

# check install
python -m ry
# run & check install w/ uv
uv run --with ry python -m ry

Quickstart

Bop around the ./examples to see some of what ry can do.

Or to play with ry in a repl, run the following:

# repl w/ ipython
uv run --with ry,ipython python -m ry.dev
# repl w/o ipython
uv run --with ry python -m ry.dev

What?

  • ry – the python package
  • ryo3-* – the rust crates that are used by ry and possibly your own pyo3-based python package

Who?

FAQ

(aka: questions that I have been asking myself)

  • Q: Why?
    • A: I (jesse) needed several hashing functions for python and then kept adding things as I needed them
  • Q: Does this have anything to do with the (excellent) package manager rye?
    • A: short answer: no. long answer: no, it does not.
  • Q: Why is the repo split into ry and ryo3?
    • A: ry is the python package, ryo3 is a rust crate setup to let you “register” functions you may want if you were writing your own pyo3-python bindings library; maybe someday the ryo3::libs module will be split up into separate packages

Crate bindings

crateryo3-crate
stdryo3-std
bytesryo3-bytes
bzip2ryo3-bzip2
dirsryo3-dirs
fspathryo3-fspath
globryo3-glob
heckryo3-heck
httpryo3-http
jiterryo3-jiter
jsonryo3-json
pydanticryo3-pydantic
reqwestryo3-reqwest
serderyo3-serde
shlexryo3-shlex
sizeryo3-size
sqlformatryo3-sqlformat
tokioryo3-tokio
tokio-websocketsryo3-tokio-websockets
ulidryo3-ulid
unindentryo3-unindent
urlryo3-url
uuidryo3-uuid
whichryo3-which
Compression~
brotliryo3-brotli
flate2ryo3-flate2
zstdryo3-zstd
Hashing~
aws-lc-rsryo3-aws-lc
fnvryo3-fnv
twox-hashryo3-twox-hash
@BurntSushi~
globsetryo3-globset
jiffryo3-jiff
memchrryo3-memchr
regexryo3-regex
same-fileryo3-same-file
walkdirryo3-walkdir

DEV

  • just is used to run tasks
  • Do not use the phrase blazing fast or any emojis in any PRs or issues or docs
  • type annotations are required
  • ruff used for formatting and linting

SEE ALSO


  1. Release‑version benchmarks of ry (via pytest-benchmark) showed no real performance variance, regardless of whether “blazingly fast” appeared in the README or docs.