Skip to main content

A lightweight Python client for REST APIs — create, read, update, and delete with zero boilerplate

Project description

CRUDs

PyPI - Version Supported Python Version Development Quality Gate Status Documentation Status

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-data via a simple files parameter
  • 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


Download files

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

Source Distribution

cruds-1.7.0.tar.gz (37.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cruds-1.7.0-py3-none-any.whl (27.2 kB view details)

Uploaded Python 3

File details

Details for the file cruds-1.7.0.tar.gz.

File metadata

  • Download URL: cruds-1.7.0.tar.gz
  • Upload date:
  • Size: 37.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for cruds-1.7.0.tar.gz
Algorithm Hash digest
SHA256 f581a722ab22029a4db12488f945791951d4fe977c6635b57b87a91a14021c18
MD5 99e7035b96e5cb2d8e4bb87d649370c4
BLAKE2b-256 3cbfca7ecf4de837aae619a3d6ddbb8dc532744c30538362db830ecd473939f8

See more details on using hashes here.

Provenance

The following attestation bundles were made for cruds-1.7.0.tar.gz:

Publisher: release.yml on johnbrandborg/cruds

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cruds-1.7.0-py3-none-any.whl.

File metadata

  • Download URL: cruds-1.7.0-py3-none-any.whl
  • Upload date:
  • Size: 27.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for cruds-1.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e32daf8f7c94d897596a2ac98164aa03bad1621e2fe93096711c1eb9ca9d7f96
MD5 dfc34826778dfa7bc79d209c844130c1
BLAKE2b-256 4c03e21413306b52cb748cbf5a12a903924337fb845cd7278f2ba385a8e4f976

See more details on using hashes here.

Provenance

The following attestation bundles were made for cruds-1.7.0-py3-none-any.whl:

Publisher: release.yml on johnbrandborg/cruds

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page