rison
Rison encoder/decoder
What it is and what it does
Rison is a data serialization format designed specifically for embedding nested structures in URIs and query strings. This Python package provides encode and decode functions that convert between Python dictionaries/lists and Rison's compact syntax, which uses parentheses and exclamation marks instead of JSON's braces and brackets. The format avoids most URI-encoding overhead by using only URI-safe characters for its syntax.
The package supports three output formats: full Rison (with outer delimiters), O-RISON (omitting outer parentheses for objects), and A-RISON (omitting outer array markers). It has no runtime dependencies and installs as a pure Python wheel. An optional Pygments extra registers lexers for syntax highlighting of Rison code in three variants.
Use it for:
- Compress complex filter or state parameters in HTTP GET requests to stay within URI length limits.
- Store application state in browser URLs while keeping them human-readable and cacheable.
- Pass nested configuration or query structures through command-line tools without shell escaping overhead.
- Encode form data with nested dictionaries and lists in a more compact format than form-encoded alternatives.
- Generate shareable links with complex parameters that remain legible when displayed or emailed.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Encodes and decodes data to and from Rison, a URI-optimized serialization format that compresses nested structures more efficiently than JSON while remaining human-readable in URLs.
Yes. Rison solves a real problem—passing nested data through URIs compactly and readably—that JSON handles poorly. The package is lightweight, actively maintained, has no dependencies, supports current Python versions, carries no known vulnerabilities, and uses a permissive license. Install it if you need to encode complex structures into query strings or URLs.
Install
rison on PyPI
pip
pip install risonuv
uv add risonpoetry
poetry add risonInstalling rison
Before you install
Low friction: pure Python wheel with no runtime dependencies. Active maintenance with recent releases; repository shows steady activity.
License in practice
MIT license permits commercial and private use with minimal restrictions; suitable for most projects.
Quickstart
pip install rison
import rison
rison.dumps({'foo': 'bar'}) # returns '(foo:bar)'
rison.loads('(foo:bar)') # returns {'foo': 'bar'}
Requires Python 3.10 or later.
Verify before relying
- Performance characteristics compared to JSON encoding for large nested structures.
- Compatibility with existing Rison implementations in other languages beyond basic round-trip encoding.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 110 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 431,377/month — #6,716 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: rison-2.0.1-py3-none-any.whl
Tags
More Internet packages
Botocore provides low-level, data-driven access…
permissive · top 100 on PyPI
aiobotocoreProvides an async client for AWS services using…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
filelockProvides a platform-independent file locking…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
googleapis-common-protosProvides common Protocol Buffer message…
permissive · top 100 on PyPI
nestedtextNestedText is a human-friendly file format for…
permissive · top 15,000 on PyPI
prisonEncodes and decodes a compact URI-friendly data…
permissive · top 5,000 on PyPI
py-ubjsonEncodes and decodes data in Universal Binary…
permissive · top 5,000 on PyPI
python-datauriParses and creates data URIs, extracting or…
permissive · top 15,000 on PyPI
curiesConverts between URIs and compact URIs (CURIEs)…
permissive · top 15,000 on PyPI
prefixcommonsConverts between CURIEs (compact URI…
permissive · top 15,000 on PyPI
yarlyarl provides an immutable URL class for…
permissive · top 100 on PyPI
cborSerializes and deserializes data in CBOR…
permissive · top 5,000 on PyPI
canonicaljsonEncodes Python objects to canonical JSON with…
permissive · top 15,000 on PyPI
python-toonEncodes and decodes TOON (Token-Oriented Object…
permissive · top 15,000 on PyPI