Skip to main content

A JSON parser written in Python.

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

json_parser-1.2.0.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

json_parser-1.2.0-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file json_parser-1.2.0.tar.gz.

File metadata

  • Download URL: json_parser-1.2.0.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for json_parser-1.2.0.tar.gz
Algorithm Hash digest
SHA256 a7d5ade07d18bbffadc34c3ccb99ed018523d4ebebbbf452226ef85b57df5b85
MD5 5ab39f0f162df47735c7e81341d80b59
BLAKE2b-256 245b5e89f17131c145aa2c2359faadf8d9165e4d6a69bb2508e7637162b3f824

See more details on using hashes here.

File details

Details for the file json_parser-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: json_parser-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 10.2 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for json_parser-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cba9a2da5c7514f485a408b05ad5272ba4d35db1a0188122163e6a0551d4ecfd
MD5 ca00df7774e8427469692f66dd61eda5
BLAKE2b-256 1048f4ae13abccddfa5eadb7332477f5a971cfd46f61bbeebbb7394a1bbf8460

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page