Skip to main content
https://drone.io/bitbucket.org/eodolphi/json-pointer/status.png

JSON Pointer

Simple implementation of the json-pointer spec:

http://tools.ietf.org/html/rfc6901

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)

Source distribution for json_pointer 0.1.2
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

Release history Release notifications | RSS feed

This release

0.1.2 This release

1 release file

0.1.1

1 release file

0.1

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page