pyyjson
Yet another Json Parser for Python
- based on yyjson bindings from @TkTech's (py_yyjson)
- original c library: yyjson
- benchmarks are based on ultrajson
Supports
it supports standard json lib's
- dumps
- loads
- dump
- load
functions
loads examples
>>> import pyyjson
>>> pyyjson.loads("[1,2,3]")
[1, 2, 3]
>>> pyyjson.loads('[{"a":"b"}, 3, 4]')
[{'a': 'b'}, 3, 4]
dumps example
>>> pyyjson.dumps([{'a': 'b'}, 3, 4])
'[{"a":"b"},3,4]'
load example
load take either string or file object. If string is given, it is assumed that it's a path to json file
>>> import pyyjson
>>> pyyjson.load("simple_json.json") # in "tests/" directory
{'a': 1, 'b': 2, 'c': 3}
dump example
dump take either string or file object. If string is given, it is assumed that it's a path to save the file
>>> import pyyjson
>>> pyyjson.dump({'a': 1, 'b': 2, 'c': 3}, "simple_json.json")
Benchmarks
each elements in cols denotes "calls/sec". Test suite is adapted from ujson's benchmark format.
| content | json | ujson | orjson | pyyjson(mine) | |
|---|---|---|---|---|---|
| Arr of 256 doubles | ENCODE | 10119 | 35361 | 170829 | 44925 |
| Arr of 256 dobules | DECODE | 28684 | 54593 | 170383 | 155127 |
| Arr of 256 UTF-8 string | ENCODE | 5247 | 7344 | 45684 | 8554 |
| Arr of 256 UTF-8 String | DECODE | 2838 | 5223 | 7248 | 6424 |
| Arr of 256 strings | ENCODE | 36624 | 59568 | 216707 | 87624 |
| Arr of 256 strings | DECODE | 66842 | 66960 | 100252 | 98242 |
| Medium complex object | ENCODE | 9948 | 22344 | 80465 | 30888 |
| Medium complex object | DECODE | 17183 | 28733 | 45008 | 29267 |
Metadata
Release files for pyyjson 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyyjson-0.2.0.tar.gz | 97.9 kB | Without provenance | Details for pyyjson-0.2.0.tar.gz |
Release files / pyyjson-0.2.0.tar.gz
| Download URL | pyyjson-0.2.0.tar.gz |
|---|---|
| Size | 97.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
60fa6f0d7669c7c53f33f43ae77aadffda60b10532bfa4e9533ed76cd0f26c71
|
|
BLAKE2b-256 checksum How to use checksums |
a83230dfcb761dfaf295866a102b986b9b8ebca941f85e1eab0d071c5af5ea1f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.10
|
Security for pyyjson 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.