Another JSONPath implementation for Python.
Project description
Python JSONPath
A flexible JSONPath engine for Python.
Table of Contents
Install
Install Python JSONPath using pip:
pip install python-jsonpath
Or Pipenv:
pipenv install -u python-jsonpath
Links
- Documentation: https://jg-rp.github.io/python-jsonpath/.
- JSONPath Syntax: https://jg-rp.github.io/python-jsonpath/syntax/
- Change log: https://github.com/jg-rp/python-jsonpath/blob/main/CHANGELOG.md
- PyPi: https://pypi.org/project/python-jsonpath
- Source code: https://github.com/jg-rp/python-jsonpath
- Issue tracker: https://github.com/jg-rp/python-jsonpath/issues
Example
import jsonpath
data = {
"users": [
{
"name": "Sue",
"score": 100,
},
{
"name": "John",
"score": 86,
},
{
"name": "Sally",
"score": 84,
},
{
"name": "Jane",
"score": 55,
},
]
}
user_names = jsonpath.findall("$.users[?@.score < 100].name", data)
print(user_names) # ['John', 'Sally', 'Jane']
License
python-jsonpath
is distributed under the terms of the MIT license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
python_jsonpath-0.7.0.tar.gz
(24.3 kB
view hashes)
Built Distribution
Close
Hashes for python_jsonpath-0.7.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5127775931673412406350fe586d8b9ae88841e8205b9d0f409bf405cc455782 |
|
MD5 | 709ffe5389570d5dbc10948d66dc0109 |
|
BLAKE2b-256 | c2c8ba93ae8da893892406289419cb06ba9b56315fbec167d105a66232fc9c40 |