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

JSONObjects allows you to declaratively specify how to extract and convert elements from a JSON document.

Project Description

jsonobjects allows you to declaratively specify how to extract and convert elements from a JSON document.


We recommend the use of virtualenv and of pip. You can then use pip install -U jsonobjects. You may also have setuptools and thus you can use easy_install -U jsonobjects. Otherwise, you can download the source from GitHub and run python install.


All dependencies are optional.


Example of schema to parse iTunes lookup response for software item:

import json
import requests
import jsonobjects as jo

class iTunesAppSchema(jo.Schema):
    id = jo.IntegerField('trackId')
    url = jo.Field('trackViewUrl')
    name = jo.StringField('trackName')
    currency = jo.StringField()
    price = jo.FloatField(min_value=0.0)
    rating = jo.FloatField('averageUserRating')
    reviews = jo.IntegerField('userRatingCountForCurrentVersion')
    version = jo.StringField()
    publisher_id = jo.IntegerField('artistId')
    publisher_url = jo.Field('artistViewUrl')
    publisher_name = jo.StringField('artistName')
    categories = jo.ListField('genres', child=jo.StringField())
    icon = jo.Field(
        ['artworkUrl512', 'artworkUrl60'], post_process=lambda v: {'url': v})
    screenshots = jo.ListField(
        'screenshotUrls', child=jo.Field(post_process=lambda v: {'url': v}))

parser = iTunesAppSchema('results[0]')

def get_app_details(app_id):
    url = '{}'
    return requests.get(url.format(app_id)).json()

details = get_app_details(880047117)

The code above produces next result:

  "categories": ["Games", "Puzzle", "Action"],
  "currency": "USD",
  "icon": {"url": ""},
  "id": 880047117,
  "name": "Angry Birds 2",
  "price": 0.0,
  "publisher_id": 298910979,
  "publisher_name": "Rovio Entertainment Ltd",
  "publisher_url": "",
  "rating": 4.0,
  "reviews": 4796,
  "screenshots": [
    {"url": ""},
    {"url": ""},
    {"url": ""},
    {"url": ""},
    {"url": ""}
  "url": "",
  "version": "2.2.1"

See for more examples.


Getting the tests running looks like:

# Install dependencies
$ pip install -r requirement.txt
# Run the test suites
$ python


The MIT License (MIT)

Contributed by Maxim Kamenkov

Release History

This version
History Node


History Node


History Node


History Node


Download Files

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

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(13.9 kB) Copy SHA256 Hash SHA256
Source None Nov 11, 2015

Supported By

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 Google Google Cloud Servers