jsua

A parser for JSON that can start at an arbitrary point in the file


License
Other
Install
pip install jsua==0.0.2

Documentation

jsua

License PyPI CircleCI

jsua, pronounced Joshua, is a streaming sax-like parser for JSON files. It's special because it doesn't require you to start at the beginning of a JSON stream. You can start anywhere, and it will eventually start spitting out events.

Usage

from jsua import SynchronizingParser
from io import StringIO

json = StringIO('{"hello": "world"}')
parser = SynchronizingParser(json)

for state, event, value in parser.parse():
    print(state, event, value)