JSON Enhanced
JSON Enhanced implements fast and pythonic queries and mutations for JSON objects.
Installation
You can install json-enhanced with pip:
pip install json-enhanced
Quickstart
import jsonutils as js
from datetime import datetime
json_data = js.JSONObject(
{
"data": [
{
"name": "Dan",
"birthday": "1991-01-02 09:00:00",
"publications": 15
},
{
"name": "Mar",
"birthday": "1991-03-02 12:30:00",
"publications": 13
},
{
"name": "Carl",
"birthday": "1950-06-02 16:00:00",
"publications": 36
},
{
"name": "Vic",
"birthday": "1986-07-02 16:00:00",
"publications": None
},
]
}
)
json_data.data._1.name
result = json_data.query(birthday__lt=datetime(1985,1,1))
result
result.first().parent
result.first().jsonpath
Documentation
Detailed documentation is available at json-enhanced.readthedocs.io.
Contributing
Contributions are welcome! Please take a look at our contributors guide.
Code of Conduct
Please read CODE_OF_CONDUCT.md for details on our code of conduct.
License
This project is licensed under the GPL-3.0 License. For details, please read our LICENSE FILE.