hammock
rest like a boss
What it is and what it does
Hammock is a thin wrapper around the requests library that lets you construct REST API URLs and make HTTP calls using Python object notation and method chaining instead of manual string formatting. Instead of building URLs like `requests.get("%s/repos/%s/%s/watchers" % (base, user, repo))`, you write `api.repos(user, repo).watchers.GET()`. It supports all HTTP verbs (GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS) and passes through any keyword arguments to the underlying requests methods, including auth, headers, and params.
The package was last updated in April 2013 and is no longer maintained. While it has no known security vulnerabilities, its age means it has not been tested against modern Python versions or recent versions of requests, and the codebase is frozen. For new projects, more actively maintained REST client libraries or modern async alternatives would be safer choices.
Use it for:
- Simplify GitHub API interactions by chaining method calls instead of constructing URLs manually.
- Build Twitter API clients where endpoint paths map naturally to object attributes and method calls.
- Maintain session-based authentication across multiple REST requests to services like JIRA by configuring auth once.
- Prototype REST API clients quickly without writing URL string formatting boilerplate.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Hammock wraps the requests library to let you build REST API calls using object notation instead of string formatting, converting URL paths into chained method calls.
No. The package is abandoned (last update April 2013, no commits since), install friction is high, and license terms are unclear. While it has no known vulnerabilities and works for simple REST wrapping, modern alternatives are actively maintained and better suited to current Python ecosystems. Use only if you are maintaining legacy code that already depends on it.
Install
hammock on PyPI
pip
pip install hammockuv
uv add hammockpoetry
poetry add hammockInstalling hammock
Before you install
High install friction due to no runtime dependencies but abandoned maintenance status—last release was in 2013, over a decade ago, with no commits since then. The package has not been updated to reflect modern Python versions or security practices.
License in practice
License treatment is unclear; the description excerpt contains MIT-like text but the metadata lists license_raw as 'UNKNOWN' with no SPDX identifier. Verify the actual license terms before relying on this package in a production or commercial context.
Quickstart
from hammock import Hammock
api = Hammock('https://api.example.com')
response = api.users('alice').posts.GET()
print(response.json)
Requires requests library (not listed as explicit dependency in metadata); Python version compatibility unspecified and untested on modern versions.
Verify before relying
- Whether requests is truly a runtime dependency or only assumed; metadata lists zero runtime dependencies.
- Actual license terms and compatibility with your project's license requirements given unclear license_raw.
- Compatibility with Python versions beyond those in use when the package was last updated in 2013.
- Whether the package still works with current versions of the requests library.
Package facts
| License | UNKNOWN (unclear) |
| Python support | not specified |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | abandoned — 4,863 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 169,349/month — #10,420 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: hammock-0.2.4.tar.gz
Tags
More WWW/HTTP packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
h11h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
httpxHTTPX is a fully featured HTTP client library…
permissive · top 100 on PyPI
httpcoreA minimal low-level HTTP client library that…
permissive · top 100 on PyPI
aiohttpaiohttp is an async HTTP client and server…
permissive · top 100 on PyPI
slumberSlumber wraps the requests library to provide…
unclear · top 15,000 on PyPI
URLObjectURLObject provides a utility class for parsing,…
permissive · top 15,000 on PyPI
uplinkUplink turns HTTP APIs into declarative Python…
permissive · top 15,000 on PyPI
responsesMocks HTTP requests made by the requests…
permissive · top 1,000 on PyPI
redfishA Python library for interacting with…
permissive · top 15,000 on PyPI
lazr.restfulclientA programmable HTTP client library for…
copyleft · top 15,000 on PyPI
pagerdutyLightweight Python client library for…
unclear · top 5,000 on PyPI
jiraA Python library that wraps the Jira REST API,…
permissive · top 1,000 on PyPI
marshmallow-jsonapiProduces JSON API 1.0-compliant output from…
permissive · top 15,000 on PyPI