View all files | ||||
| Ken Robbins <ken@kenrobbins.com>
Lele Gaifax <lele@metapensiero.it> |
| MIT License |
RapidJSON is an extremely fast C++ JSON parser and serialization library: this module wraps it into a Python 3 extension, exposing its serialization/deserialization (to/from either bytes, str or file-like instances) and JSON Schema validation capabilities.
Latest version documentation is automatically rendered by Read the Docs.
First install python-rapidjson:
or, if you prefer Conda:
Basic usage looks like this:
Most functionalities are exposed both as functions and as classes.
The following uses a relaxed syntax Decoder instance, that handles JSONC and trailing commas:
If you want to install the development version (maybe to contribute fixes or enhancements) you may clone the repository:
Note
The --recursive option is needed because we use a submodule to include RapidJSON sources. Alternatively you can do a plain clone immediately followed by a git submodule update --init.
Alternatively, if you already have (a compatible version of) RapidJSON includes around, you can compile the module specifying their location with the option --rj-include-dir, for example:
A set of makefiles implement most common operations, such as build, check and release; see make help output for a list of available targets.
python-rapidjson tries to be as performant as possible while staying compatible with the json module.
See this section in the documentation for a comparison with other JSON libraries.
Although we tried to implement an API similar to the standard library json, being a strict drop-in replacement in not our goal and we have decided to depart from there in some aspects. See this section in the documentation for further details.