Skip to content

Commit

Permalink
fix: readme
Browse files Browse the repository at this point in the history
  • Loading branch information
iw4p committed Nov 24, 2023
1 parent b497322 commit b9e5d91
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# PartialJson

## Parse Partial and incomplete JSON in python

[![Partialjson](https://github.com/iw4p/partialjson/raw/main/images/partialjson.png
)](https://pypi.org/project/partialjson/)

## Parse Partial and incomplete JSON in python

![](https://github.com/iw4p/partialjson/raw/main/images/partialjson.gif)

### Parse Partial and incomplete JSON in python with just 3 lines of python code.

[![PyPI version](https://img.shields.io/pypi/v/partialjson.svg)](https://pypi.org/project/partialjson)
Expand Down
15 changes: 15 additions & 0 deletions example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from partialjson.json_parser import JSONParser
import time, sys

parser = JSONParser()

incomplete_json = '{"name": "John", "age": 18, "family":'

json = ""

for char in incomplete_json:
json += char
print(f'\nIncomplete or streaming json:\n{json}')
print(f'Final and usable JSON without crashing:\n{parser.parse(json)}')
sys.stdout.flush()
time.sleep(0.3)
Binary file added images/partialjson.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b9e5d91

Please sign in to comment.