Skip to main content

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 files for hunk 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distributions (sdists)

Source distribution for hunk 0.1.0
File Size Uploaded
hunk-0.1.0.zip 18.3 kB Details
hunk-0.1.0.tar.gz 8.6 kB Details

Release files / hunk-0.1.0.zip

Download URL hunk-0.1.0.zip
Size 18.3 kB
Tags Source
SHA-256 checksum
How to use checksums
701f384da556502b213d808dae93fa5ab9eb8cfdb64335c29aa0d5f1a288053e
BLAKE2b-256 checksum
How to use checksums
f41777b48274c17ee0202cebd1dda4578dc11319e5ac8ad90c57be32f5bf0d36
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / hunk-0.1.0.tar.gz

Download URL hunk-0.1.0.tar.gz
Size 8.6 kB
Tags Source
SHA-256 checksum
How to use checksums
d098e0a6ce2bad0bcb5c23bcc70bb5d8d10e8c401434dba3354be80dbfa7d5ab
BLAKE2b-256 checksum
How to use checksums
b103ae015d480d14e548231736151355d000640be18e5b05927eaa1daae13ae7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page