Metadata-Version: 2.1
Name: json-parser
Version: 1.1.2
Summary: A JSON parser written in Python.
Home-page: https://github.com/tusharsadhwani/json_parser
Author: Tushar Sadhwani
Author-email: tushar.sadhwani000@gmail.com
License: UNKNOWN
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
Requires-Dist: pytest

# json_parser

An _efficient_ JSON parser written in Python.

## Installation

Install it via pip:

```console
pip install json-parser
```

## Usage

```py
import json_parser

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

## Benchmarks

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

```python
>>> 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:

```console
pip install -e .
pytest
```

[1]: https://raw.githubusercontent.com/json-iterator/test-data/master/large-file.json


