--- id: prison version: "0.2.1" license: MIT license_treatment: permissive maintenance: active --- # prison — Rison encoder/decoder License: permissive · Maintenance: active · Downloads: 10.1M/mo ## What it is and what it does This package provides a Python encoder and decoder for a data serialization format designed specifically for embedding structured data in URIs while remaining human-readable and compact. The format uses URI-safe syntax: parentheses for objects, exclamation-mark-prefixed arrays, single quotes for strings, and special tokens for literals. It expresses the same data model as JSON but produces strings that survive URI encoding with minimal bloat. The package supports three output formats: full format with outer delimiters, object format with outer parentheses omitted, and array format with outer array markers omitted. A command-line tool converts between this format and JSON. Optional Pygments lexer support is available via an extra dependency. Use it for: - Encode nested query parameters in URLs without excessive percent-encoding bloat - Pass structured configuration or filter data through URI query strings in web applications - Convert between this format and JSON in command-line pipelines - Syntax-highlight data in documentation or code editors via Pygments lexers ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Encodes and decodes a compact URI-friendly data serialization format that expresses the same data structures as JSON but with minimal URI encoding overhead. Yes. The package is stable, has no known vulnerabilities, low install friction, and fills a specific niche: passing structured data through URIs compactly. Install it if you need to embed nested objects or arrays in query parameters without the verbosity of JSON or form encoding. Active repository maintenance supports continued reliability. ## Install pip install prison uv add prison poetry add prison ## Installing prison Before you install: Low install friction with a single runtime dependency (six). Actively maintained as of the last commit in 2026, though the latest release is from 2021. License in practice: MIT license permits commercial and private use with minimal restrictions; suitable for most projects. Quickstart: pip install prison import prison prison.dumps({'foo': 'bar'}) # Returns: '(foo:bar)' prison.loads('(foo:bar)') # Returns: {'foo': 'bar'} Verify before relying: - Whether the 2021 release date reflects active development or if the repository is maintained without frequent releases - Performance characteristics when encoding or decoding deeply nested structures ## Package facts - License: MIT (permissive) - Python support: unspecified - Install friction: low - Maintenance: active - Downloads: 10.1M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags compact uri serialization, json alternative for urls, uri-safe data format, query parameter encoding, nested data in uris, data encoder decoder, serialization, uri-encoding, cli-tool [View on SkillFed](https://skillfed.io/packages/prison) · [View on PyPI](https://pypi.org/project/prison/)