Skip to main content

json_parser

An efficient JSON parser written in Python.

Installation

Install it via pip:

pip install json-parser

Usage

import json_parser

data = json_parser.parse('{"value": 42}')
print(data['value']) # 42

Benchmarks

Running it on this 25MB JSON file gave the following results:

>>> with open('large-file.json') as f:
...   t = time.time()
...   x = json.load(f)
...   t = time.time() - t
...   print(t, 'seconds')
...
0.6405608654022217 seconds
>>> with open('large-file.json') as f:
...   t = time.time()
...   y = json_parser.parse(f.read())
...   t = time.time() - t
...   print(t, 'seconds')
...
22.286625385284424 seconds
>>> x == y
True

So, it's about 34x slower than the builtin json. Which, is par for the course when it comes to pure python.

Testing

Clone the app and run the following:

pip install -e '.[dev]'
pytest

Metadata

Release files for json-parser 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for json-parser 1.2.0
File Size Uploaded
json_parser-1.2.0.tar.gz 9.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for json-parser 1.2.0
File Interpreter ABI Platform
json_parser-1.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 19.3 kB

Release files / json_parser-1.2.0.tar.gz

Download URL json_parser-1.2.0.tar.gz
Size 9.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a7d5ade07d18bbffadc34c3ccb99ed018523d4ebebbbf452226ef85b57df5b85
BLAKE2b-256 checksum
How to use checksums
245b5e89f17131c145aa2c2359faadf8d9165e4d6a69bb2508e7637162b3f824
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.9.2

Release files / json_parser-1.2.0-py3-none-any.whl

Download URL json_parser-1.2.0-py3-none-any.whl
Size 10.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cba9a2da5c7514f485a408b05ad5272ba4d35db1a0188122163e6a0551d4ecfd
BLAKE2b-256 checksum
How to use checksums
1048f4ae13abccddfa5eadb7332477f5a971cfd46f61bbeebbb7394a1bbf8460
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.9.2

Release history Release notifications | RSS feed

This release

1.2.0 This release

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page