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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file python_jsonpath-0.5.0.post1.tar.gz.
File metadata
- Download URL: python_jsonpath-0.5.0.post1.tar.gz
- Upload date:
- Size: 22.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ca420437680170da36e3337f3865e31eac9548d55f1f6d3b4059df09bf5f03d8
|
|
| MD5 |
244fb76a0cdaa6b26f77c6d369b03a58
|
|
| BLAKE2b-256 |
5134ad7002e36949d988bb6323620e88144dbc34da89b26defaf92099e1f28c2
|
File details
Details for the file python_jsonpath-0.5.0.post1-py3-none-any.whl.
File metadata
- Download URL: python_jsonpath-0.5.0.post1-py3-none-any.whl
- Upload date:
- Size: 29.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d463e09b343a1c734dc455bbd54bce1ce45f5dd48d84f40e9f03708b0b9db84
|
|
| MD5 |
f8a0668a3889ee2b724f740d6cbeff8a
|
|
| BLAKE2b-256 |
9f0eb014da943d001b9805b257169c122a937db92bd438cbb80aa977cf551b3a
|