python-rapidjson
Python wrapper around rapidjson
What it is and what it does
python-rapidjson is a Python wrapper around RapidJSON, a C++ JSON parser and serialization library. It exposes fast JSON encoding and decoding for bytes, strings, and file-like objects, plus JSON Schema validation capabilities. The module is designed to be mostly compatible with Python's standard json module while prioritizing performance.
The package supports both functional and class-based APIs. It includes a Decoder class that can parse relaxed JSON syntax (JSONC with comments and trailing commas), and an Encoder class for customized serialization. It has no runtime dependencies and is actively maintained with wheels pre-built for multiple Python versions and architectures.
Use it for:
- Replace json module in performance-critical applications that serialize/deserialize large JSON payloads frequently
- Parse JSON with comments (JSONC) or trailing commas in configuration files or development workflows
- Validate incoming JSON data against JSON Schema before processing in web services or APIs
- Stream large JSON documents to file-like objects with configurable chunk sizes
- Serialize Python objects to JSON in data pipelines where speed matters
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Fast JSON serialization and deserialization with JSON Schema validation, wrapping the C++ RapidJSON library into a Python 3 extension that handles bytes, strings, and file-like objects.
Yes. python-rapidjson is actively maintained, has no known vulnerabilities, supports current Python versions (3.9–3.14), and offers genuine performance benefits over the standard library for JSON-heavy workloads. The MIT license is permissive. Medium install friction (compiled extension) is mitigated by pre-built wheels for most platforms. Install if you need faster JSON handling or JSONC support; skip if standard json performance is adequate.
Install
python-rapidjson on PyPI
pip
pip install python-rapidjsonuv
uv add python-rapidjsonpoetry
poetry add python-rapidjsonInstalling python-rapidjson
Before you install
Medium install friction due to compiled C++ extension requiring platform-specific wheels, but wheels are pre-built for Python 3.9–3.14 across macOS, Linux (including ARM and ppc64le), and Windows, reducing build complexity for most users.
License in practice
MIT License permits unrestricted use, modification, and distribution in commercial and private projects with minimal obligations.
Quickstart
pip install python-rapidjson
import rapidjson
data = {'foo': 100, 'bar': 'baz'}
print(rapidjson.dumps(data))
print(rapidjson.loads('{"bar":"baz","foo":100}'))
Verify before relying
- Exact performance gains versus standard library json module and other third-party JSON libraries
- Whether JSON Schema validation supports all draft versions or specific subsets
- Memory overhead or constraints when processing very large JSON documents
Package facts
| License | MIT License (permissive) |
| Python support | supports the current Python release (>=3.6) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 250 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 4,949,031/month — #2,191 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: python_rapidjson-1.23-cp310-cp310-macosx_10_9_x86_64.whl; python_rapidjson-1.23-cp310-cp310-macosx_11_0_arm64.whl; python_rapidjson-1.23-cp310-cp310-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl; python_rapidjson-1.23-cp310-cp310-manylinux_2_24_ppc64le.manylinux_2_28_ppc64le.whl; python_rapidjson-1.23-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; python_rapidjson-1.23-cp310-cp310-musllinux_1_2_aarch64.whl; python_rapidjson-1.23-cp310-cp310-musllinux_1_2_ppc64le.whl; python_rapidjson-1.23-cp310-cp310-musllinux_1_2_x86_64.whl; python_rapidjson-1.23-cp310-cp310-win32.whl; python_rapidjson-1.23-cp310-cp310-win_amd64.whl; python_rapidjson-1.23-cp311-cp311-macosx_10_9_x86_64.whl; python_rapidjson-1.23-cp311-cp311-macosx_11_0_arm64.whl; python_rapidjson-1.23-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl; python_rapidjson-1.23-cp311-cp311-manylinux_2_24_ppc64le.manylinux_2_28_ppc64le.whl; python_rapidjson-1.23-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; python_rapidjson-1.23-cp311-cp311-musllinux_1_2_aarch64.whl; python_rapidjson-1.23-cp311-cp311-musllinux_1_2_ppc64le.whl; python_rapidjson-1.23-cp311-cp311-musllinux_1_2_x86_64.whl; python_rapidjson-1.23-cp311-cp311-win32.whl; python_rapidjson-1.23-cp311-cp311-win_amd64.whl
Keywords: json, jsonc, rapidjson
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
ujsonUltra-fast JSON encoding and decoding in pure C…
permissive · top 1,000 on PyPI
pysimdjsonPython bindings for the simdjson…
unclear · top 5,000 on PyPI
simplejsonsimplejson encodes Python objects to JSON and…
permissive · top 1,000 on PyPI
json-with-commentsParses and serializes JSON with support for…
permissive · top 15,000 on PyPI
json5kitParses JSON5 (JSON with comments, trailing…
permissive · top 15,000 on PyPI
rapidyamlParses and emits YAML documents via a fast C++…
permissive · top 15,000 on PyPI
dirtyjsonParses JSON-like data from files containing…
permissive · top 5,000 on PyPI
jsoncommentParses JSON with comments, multiline strings,…
permissive · top 15,000 on PyPI
http-sfParses and serializes HTTP Structured Fields as…
permissive · top 15,000 on PyPI
ijsonijson is an iterative JSON parser that reads…
permissive · top 1,000 on PyPI