Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eatonphil/pj
A small, hand-written Python JSON library
https://github.com/eatonphil/pj
Last synced: 24 days ago
JSON representation
A small, hand-written Python JSON library
- Host: GitHub
- URL: https://github.com/eatonphil/pj
- Owner: eatonphil
- Created: 2018-05-06T17:53:12.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-08-24T23:15:12.000Z (about 2 years ago)
- Last Synced: 2024-10-13T04:13:05.257Z (about 1 month ago)
- Language: Python
- Homepage: http://notes.eatonphil.com/writing-a-simple-json-parser.html
- Size: 8.79 KB
- Stars: 93
- Watchers: 3
- Forks: 11
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# pj
This is a small, hand-written library for encoding and decoding JSON
strings and objects in Python. I wrote it because I wanted a small
example to demonstrate the simplest hand-written parser techniques
and couldn't find any obvious results on Google.[Here](http://notes.eatonphil.com/writing-a-simple-json-parser.html)
is the original blog post explaining the concepts and implementation
of this library.### Use
```python
import pjprint(pj.to_string(pj.from_string('{"foo":{"bar":[1,2,3]}}')))
```### Tests
```bash
python3 -m unittest
```### Quality
The number detection is bad. There are tons of missing cases not
handled. There is no line/column tracking. The primary purpose of this
library is for education.