Registry / http-networking / slumber

slumber

JSON →
library0.7.1pypypi✓ verified 90d ago

A library that makes consuming a REST API easier and more convenient. Current version is 0.7.1, with no recent releases (last release 2014-07-14). Considered in maintenance mode.

pip install slumber
INSTALL
IMPORT
SIG · SLUMBER
S
slumber
http-networkingpythonv0.7.1
Install
3.1s avg
Import
572ms
Disk
20MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v0.7.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.600s · 22.4MB
glibc
py 3.10–3.95 runs
installs and imports cleanly · install 3.1s · import 0.544s · 23MB
20MB installed
● package 20MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Slumber API base class
✓ from slumber import API
Resource object
✓ from slumber import Resource

Create an API instance and access resources via attribute chaining.

from slumber import API # Replace with your API URL api = API('https://api.example.com', auth=('username', 'password')) # If no authentication: # api = API('https://api.example.com') users = api.users.get() print(users) # For a specific resource: # user = api.users(1).get()
Debug
Known issues
breakingSlumber 0.7.x changed resource creation: previously you could call `api.users.get()` directly, but now you must use `api.users.get()` (with parentheses) to trigger a GET request. Older versions allowed `api.users.get` without parentheses.
fix
Always call resource methods with parentheses: `api.users.get()` not `api.users.get`.
affects: >=0.7.0
deprecatedAuthentication via `slumber.API(url, auth=(user, pass))` works but is considered deprecated in favor of passing a `requests.Session` with auth configured.
fix
Use `session = requests.Session(); session.auth = (user, pass); api = API(url, session=session)`.
affects: >=0.7.0
gotchaSlumber does not support async/await. It is synchronous only. If you need async, consider using `httpx` or `aiohttp` based clients.
fix
Use a different library for async workflows.
affects: all
gotchaResource paths with trailing slashes may cause unexpected 301 redirects. Slumber does not normalize trailing slashes automatically.
fix
Ensure your API URLs do not have trailing slashes, or handle redirects explicitly.
affects: all
Errors
Common errors & fixes
AttributeError: 'NoneType' object has no attribute 'get'
Resource not found or URL incorrect, resulting in None response.
fix
Check the API URL and endpoint. Use `api.users.get()` with parentheses.
TypeError: 'Resource' object is not callable
Trying to call a resource object directly instead of using `.get()`, `.post()`, etc.
fix
Use `api.users.get()` instead of `api.users()`.
ImportError: No module named slumber
Slumber is not installed or installed in a different environment.
fix
Run `pip install slumber` and ensure you are using the correct Python environment.
Upgrade
Version history
0.7.1latest on PyPI · released May 14, 2015
Audit
Dependencies
requestsrequiredHTTP client used by slumber
Agent activity
28 hits · last 30 days
node
26
OpenAI (training)
1
Resources
slumber — pip install slumber · libregistry