A lightweight Python client for REST APIs — create, read, update, and delete with zero boilerplate
Project description
CRUDs
CRUDs is a lightweight Python client for REST APIs — create, read, update, and delete with zero boilerplate.
import cruds
api = cruds.Client("https://api.example.com", auth="your-token")
# Create a resource
user = api.create("users", data={"name": "Ada", "role": "engineer"})
# Read it back
user = api.read(f"users/{user['id']}")
# Update it
api.update(f"users/{user['id']}", data={"role": "lead"})
# Delete it
api.delete(f"users/{user['id']}")
No response objects to unpack. No manual JSON parsing. No boilerplate retry logic. Just your data.
Quickstart
pip install cruds
import cruds
catfacts = cruds.Client("catfact.ninja")
fact = catfacts.read("fact")
print(fact["fact"])
Why CRUDs over requests/httpx?
| You get | Without writing |
|---|---|
| Semantic CRUD methods | HTTP method boilerplate |
| Automatic JSON SerDes | .json() / .raise_for_status() calls |
| Retry with backoff | HTTPAdapter / Retry setup |
| Bearer, Basic & OAuth2 auth | Manual header management |
| SSL verification | certifi wiring |
# requests — 6 lines of ceremony
import requests
response = requests.get("https://api.example.com/users",
headers={"Authorization": "Bearer token"})
response.raise_for_status()
users = response.json()
# CRUDs — 2 lines of intent
import cruds
users = cruds.Client("api.example.com", auth="token").read("users")
Features
- Authentication — Bearer tokens, username/password, and OAuth2 (Client Credentials, Resource Owner Password, Authorization Code with CSRF protection)
- JSON Serialization — Send and receive Python dicts and lists directly
- Multipart File Uploads — Upload files with
multipart/form-datavia a simplefilesparameter - Retries with backoff — Configurable retry count, backoff factor, and status codes (429, 500–504, etc.)
- Error handling — Automatic exceptions for 4xx/5xx responses
- SSL verification — Enabled by default via certifi
- Logging — Built-in INFO/DEBUG logging for monitoring
- Interfaces — Build SDKs with YAML configuration (ships with a full Planhat interface)
Documentation
Full user guide, API reference, and examples at cruds.readthedocs.io.
License
MIT — see LICENSE.
Credits
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cruds-1.6.0.tar.gz.
File metadata
- Download URL: cruds-1.6.0.tar.gz
- Upload date:
- Size: 36.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3fcac41e3f1eafbd22235e5068cb1aec3c161cbe72feec0c040a45e9ba8f088d
|
|
| MD5 |
de8bbb11a0099ec5fa69f471a7b9edfb
|
|
| BLAKE2b-256 |
152c24006fd0fb9b309ac5e1976fbeed1605e8a5f7e7f7036e1a2a5292ed89ca
|
Provenance
The following attestation bundles were made for cruds-1.6.0.tar.gz:
Publisher:
release.yml on johnbrandborg/cruds
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cruds-1.6.0.tar.gz -
Subject digest:
3fcac41e3f1eafbd22235e5068cb1aec3c161cbe72feec0c040a45e9ba8f088d - Sigstore transparency entry: 1074785788
- Sigstore integration time:
-
Permalink:
johnbrandborg/cruds@26faf215609cab7db90fa436aa52d6820be6f9f5 -
Branch / Tag:
refs/tags/1.6.0 - Owner: https://github.com/johnbrandborg
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@26faf215609cab7db90fa436aa52d6820be6f9f5 -
Trigger Event:
release
-
Statement type:
File details
Details for the file cruds-1.6.0-py3-none-any.whl.
File metadata
- Download URL: cruds-1.6.0-py3-none-any.whl
- Upload date:
- Size: 27.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
684106e7fc94793972e7a384d538abadbd3d666f2beb6ccd97f3b0f92275cbe5
|
|
| MD5 |
5a874c5553b4dda05bfd7a0b287728d2
|
|
| BLAKE2b-256 |
2fd0e09d78f598a74422544e6ce33507b5b27a736f45968136d7970f0570702b
|
Provenance
The following attestation bundles were made for cruds-1.6.0-py3-none-any.whl:
Publisher:
release.yml on johnbrandborg/cruds
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cruds-1.6.0-py3-none-any.whl -
Subject digest:
684106e7fc94793972e7a384d538abadbd3d666f2beb6ccd97f3b0f92275cbe5 - Sigstore transparency entry: 1074785812
- Sigstore integration time:
-
Permalink:
johnbrandborg/cruds@26faf215609cab7db90fa436aa52d6820be6f9f5 -
Branch / Tag:
refs/tags/1.6.0 - Owner: https://github.com/johnbrandborg
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@26faf215609cab7db90fa436aa52d6820be6f9f5 -
Trigger Event:
release
-
Statement type: