Skip to main content

Mock for JSON API server.

Project description

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


hunk can be installed via pip or easy_install:

$ pip install hunk


$ easy_install hunk


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/
|-- 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"}

Project details

Download files

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

Files for hunk, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size hunk-0.1.0.tar.gz (8.6 kB) File type Source Python version None Upload date Hashes View
Filename, size (18.3 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page