Another JSONPath implementation for Python.
Project description
Python JSONPath
A flexible JSONPath engine for Python.
Table of Contents
Install
Install Python JSONPath using Pipenv:
pipenv install -u python-jsonpath
or pip:
pip install 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 = {
"categories": [
{
"name": "footwear",
"products": [
{
"title": "Trainers",
"description": "Fashionable trainers.",
"price": 89.99,
},
{
"title": "Barefoot Trainers",
"description": "Running trainers.",
"price": 130.00,
},
],
},
{
"name": "headwear",
"products": [
{
"title": "Cap",
"description": "Baseball cap",
"price": 15.00,
},
{
"title": "Beanie",
"description": "Winter running hat.",
"price": 9.00,
},
],
},
],
"price_cap": 10,
}
products = jsonpath.findall("$..products.*", data)
print(products)
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
Built Distribution
Close
Hashes for python_jsonpath-0.5.0.post1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca420437680170da36e3337f3865e31eac9548d55f1f6d3b4059df09bf5f03d8 |
|
MD5 | 244fb76a0cdaa6b26f77c6d369b03a58 |
|
BLAKE2b-256 | 5134ad7002e36949d988bb6323620e88144dbc34da89b26defaf92099e1f28c2 |
Close
Hashes for python_jsonpath-0.5.0.post1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d463e09b343a1c734dc455bbd54bce1ce45f5dd48d84f40e9f03708b0b9db84 |
|
MD5 | f8a0668a3889ee2b724f740d6cbeff8a |
|
BLAKE2b-256 | 9f0eb014da943d001b9805b257169c122a937db92bd438cbb80aa977cf551b3a |