This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Helpers for handling jsonhome documents

Introduction

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

Building

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

>>> import jsonhome

>>> doc = jsonhome.Document()

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

>>> print(doc.to_json())
{
    "resources": {
        "http://mysite.com/rel/widgets": {
            "href-template": "/widgets{/widget_id}",
            "href-vars": {
                "widget_id": "http://mysite.com/param/widget"
            },
            "hints": {
                "accept-post": [
                    "application/json"
                ],
                "allow": [
                    "GET",
                    "POST"
                ]
            }
        }
    }
}

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

Consuming

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('http://mysite.com/rel/widgets', widget_id='1234')
'/widgets/1234'

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

>>> print(doc['http://mysite.com/rel/widgets'].href_vars)
{"widget_id": "http://mysite.com/param/widget"}
Release History

Release History

0.1.0

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.0.post8

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
jsonhome-0.1.0-py2.py3-none-any.whl (12.9 kB) Copy SHA256 Checksum SHA256 py2.py3 Wheel Jul 25, 2015
jsonhome-0.1.0.tar.gz (15.7 kB) Copy SHA256 Checksum SHA256 Source Jul 25, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development 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