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!

Mock for JSON API server.

Project Description

Helps client-side Web development by mocking JSON API server.

Installation

hunk can be installed via pip or easy_install:

$ pip install hunk

Or:

$ easy_install hunk

Usage

Setup data directory and files.

  • Directories under the root have a HTTP method name
  • Directories and files have name to be resource path
  • Files have conent to be response JSON

For example:

$ tree demo/simple/
demo/simple/
|-- get
|   |-- members
|   |   |-- 100.json
|   |   |-- 200.json
|   |   |-- 300.json
|   |   ...
|   +-- sounds.json
|-- post
|   +-- members.json
...

Move to the root directory and run hunk:

$ cd demo/simple/
$ hunk
 * Running on http://localhost:8080/

Now, you can access Web API with HTTP:

$  curl http://localhost:8080/members/100
{"gender": "female", "kind": "human", "name": "Dorothy"}

$ curl http://localhost:8080/members
[{"kind": "scarecrow", "name": "Hunk"}, ...]

$ curl http://localhost:8080/sounds
[{"title": "Over The Rainbow"}, ... ]

$ curl http://localhost:8080/members -X POST
{"result": "success"}
Release History

Release History

This version
History Node

0.1.0

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
hunk-0.1.0.tar.gz (8.6 kB) Copy SHA256 Checksum SHA256 Source Feb 18, 2014
hunk-0.1.0.zip (18.3 kB) Copy SHA256 Checksum SHA256 Source Feb 18, 2014

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