Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Simple implementation of the json-pointer spec

Project Description

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 History

Release History

This version
History Node

0.1.2

History Node

0.1.1

History Node

0.1

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
json_pointer-0.1.2.tar.gz (3.2 kB) Copy SHA256 Checksum SHA256 Source Oct 12, 2013

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting