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!

Helpers for handling jsonhome documents

Project Description

Helpers for handling jsonhome documents


The jsonhome library provides a simple way to build and consume compliant json-home documents.


To build a jsonhome document you create a document and then add resources:

>>> import jsonhome

>>> doc = jsonhome.Document()

>>> doc.add_resource('',
...                  uri='/widgets{/widget_id}'
...                  uri_vars={'widget_id': ''},
...                  allow_get=True,
...                  accept_post=['application/json'])

>>> print(doc.to_json())
    "resources": {
        "": {
            "href-template": "/widgets{/widget_id}",
            "href-vars": {
                "widget_id": ""
            "hints": {
                "accept-post": [
                "allow": [

Additional parameters to creating resources can be found on the module documentation.


To consume a json-home document you load it and then fetch the URIs you need:

>>> doc = jsonhome.Document.from_json(data)

>>> print(doc.get_uri('', widget_id='1234')

Or for specific information you can find helpers on the resource:

>>> print(doc[''].href_vars)
{"widget_id": ""}

Release History

This version
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
(12.9 kB) Copy SHA256 Hash SHA256
Wheel py2.py3 Jul 25, 2015
(15.7 kB) Copy SHA256 Hash SHA256
Source None Jul 25, 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 DreamHost DreamHost Log Hosting