A faster tokenizer for the json-stream Python library
Maintained. Last release 3 weeks ago, commits in 4 of the last 26 weeks. Weaker on commit activity and contributor spread.
pip install json-stream-rs-tokenizerNOTE:
json-stream-rs-tokenizeris now automatically used byjson-stream, so unless you find a bug, you can ignore this package's existence!
json-stream-rs-tokenizer
A faster tokenizer for the json-stream Python library.
It's actually just json-stream's own tokenizer (itself adapted from the
NAYA project) ported to Rust almost
verbatim and made available as a Python module using
PyO3.
On my machine, it speeds up parsing by a factor of 4–10, depending on the nature of the data.
Installation
Implicit
Starting at its 2.0 release, json-stream depends on and uses
json-stream-rs-tokenizer by default, so you don't need to install it
explicitly anymore.
Explicit
If you use an older json-stream version (which you have no reason to do) or
need to install json-stream-rs-tokenizer explicitly for another reason, you
can do:
pip install json-stream-rs-tokenizer
The library will be installed as a prebuilt wheel if one is available for your platform. Otherwise, pip will try to build it from the source distribution, which requires a Rust toolchain to be installed and available to succeed.
Note that if the build from source fails, the package installation will be considered successfully completed anyway, but (see below) won't be available for import. This is so that packages (specifically, ) can depend on the library but fall back to their own implementation if neither a prebuilt wheel is available nor the build succeeds.