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.6.0.tar.gz (36.9 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.6.0-py3-none-any.whl (27.0 kB view details)

Uploaded Python 3

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

Hashes for cruds-1.6.0.tar.gz
Algorithm Hash digest
SHA256 3fcac41e3f1eafbd22235e5068cb1aec3c161cbe72feec0c040a45e9ba8f088d
MD5 de8bbb11a0099ec5fa69f471a7b9edfb
BLAKE2b-256 152c24006fd0fb9b309ac5e1976fbeed1605e8a5f7e7f7036e1a2a5292ed89ca

See more details on using hashes here.

Provenance

The following attestation bundles were made for cruds-1.6.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.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

Hashes for cruds-1.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 684106e7fc94793972e7a384d538abadbd3d666f2beb6ccd97f3b0f92275cbe5
MD5 5a874c5553b4dda05bfd7a0b287728d2
BLAKE2b-256 2fd0e09d78f598a74422544e6ce33507b5b27a736f45968136d7970f0570702b

See more details on using hashes here.

Provenance

The following attestation bundles were made for cruds-1.6.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