Access nested dicts and lists using JSON-like path notation.
Note that this code is written for python 3.
The notation is as follows:
You can just write the names of components in your path like you would in javascript:
foo.bar.baz
To access arrays or names with spaces in them, use the ‘[]’ notation. You can use negative indices with arrays to count from the end.
[“foo”][“bar”][“baz”] array[-1].attr [3]
You can use the wildcard character ‘*’ to iterate over all elements:
foo.*.baz [“foo”][*][“baz”]
This may return more or less than a single element. Use get to get the first one, and get_all to get a list of all possibilities. If you want to skip any number of elements in path, use two dots ‘..’:
foo..baz
You can slice the arrays just like in python:
array[1:-1:2]
Finally, you can filter the elements:
foo(bar.baz=true) foo.bar(baz>0).baz foo(bar=”yawn”).bar
At the moment only =, >, <, >=, <= and != operators are available, and you can only use them with strings, integers and boolean values.
This code was written in STX Next.
Metadata
Release files for jpath 1.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| jpath-1.6.tar.gz | 4.4 kB | Without provenance | Details for jpath-1.6.tar.gz |
Release files / jpath-1.6.tar.gz
| Download URL | jpath-1.6.tar.gz |
|---|---|
| Size | 4.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c694674beda13ccb51e8e3a7821e5516838eb5c10b171714fc960e911b38694b
|
|
BLAKE2b-256 checksum How to use checksums |
1cd3d931faffbf46803ca2d5bc7e29eae6c1482522e51b3b9dfb706c58d69398
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for jpath 1.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.