JSON Pointer
Simple implementation of the json-pointer spec:
Usage
JSON pointer make it possible to retrieve arbitrary sub-objects from json objects.
>>> import json_pointer
>>> data = {'a': {'b': 'c'}, 'd': ['e', 'f', 'g']}
>>> json_pointer.Pointer('/a/b').get(data)
'c'
>>> json_pointer.Pointer('/d/1').get(data)
'f'
It is also possible to set and unset data using pointers.
>>> data = {'a': {'b': 'c'}, 'd': ['e', 'f', 'g']}
>>> json_pointer.Pointer('/a/b').set('d')
>>> json_pointer.Pointer('/a/c').set('h')
>>> data
{'a': {'d': 'c', 'c': 'h'}, 'd': ['e', 'f', 'g']}
>>> json_pointer.Pointer('/d/1').unset(data)
{'a': {'d': 'c', 'c': 'h'}, 'd': ['f', 'g']}
Release files for json_pointer 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| json_pointer-0.1.2.tar.gz | 3.2 kB | Details |
Release files / json_pointer-0.1.2.tar.gz
| Download URL | json_pointer-0.1.2.tar.gz |
|---|---|
| Size | 3.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bcc02765958406430cd0873160ff74178ab29cf9f5ebc012496ff23314df951f
|
|
BLAKE2b-256 checksum How to use checksums |
6198f4598c560918a3e4ed8e21926c40865fc65927aa50bb6c7bf94c5084b8c5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |