Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Swarmauri's CroutonClient

CroutonClient is a Python library for streamlined REST API interactions, supporting both synchronous and asynchronous operations for CRUD tasks.


Initialization

from crouton_client import CroutonClient

client = CroutonClient(API_ROOT="https://api.example.com", ACCESS_STRING="your-token")

Common Operations

GET

  • Synchronous:
    response = client.get(resource="items", item_id="123", filters={"status": "active"})
    
  • Asynchronous:
    response = await client.aget(resource="items", item_id="123")
    

POST

  • Synchronous:
    response = client.post(resource="items", data_obj={"name": "Item", "price": 10.0})
    
  • Asynchronous:
    response = await client.apost(resource="items", data_obj={"name": "Item", "price": 10.0})
    

PUT

  • Synchronous:
    response = client.put(resource="items", data_obj={"price": 15.0}, item_id="123")
    
  • Asynchronous:
    response = await client.aput(resource="items", data_obj={"price": 15.0}, item_id="123")
    

DELETE

  • Synchronous:
    response = client.delete(resource="items", item_id="123")
    
  • Asynchronous:
    response = await client.adelete(resource="items", item_id="123")
    

Features

  1. Synchronous & Asynchronous: Methods available for GET, POST, PUT, DELETE.
  2. Authentication: Pass ACCESS_STRING for token-based requests.
  3. Auto-Generated IDs: post and apost auto-generate id fields if not provided.
  4. Logging: Logs all requests and responses for debugging.

Error Handling

Raises ValueError for failed requests:

try:
    client.get(resource="invalid")
except ValueError as e:
    print(f"Error: {e}")

Summary Table

Operation Synchronous Asynchronous
GET get() aget()
POST post() apost()
PUT put() aput()
DELETE delete() adelete()

CroutonClient simplifies REST API interactions, allowing you to focus on application logic instead of repetitive request handling.

Metadata

Release files for crouton-client 0.0.5.dev2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for crouton-client 0.0.5.dev2
File Size Uploaded Provenance Actions
crouton_client-0.0.5.dev2.tar.gz 3.5 kB Without provenance Details for crouton_client-0.0.5.dev2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for crouton-client 0.0.5.dev2
File Interpreter ABI Platform Actions
crouton_client-0.0.5.dev2-py3-none-any.whl Python 3 none any Details for crouton_client-0.0.5.dev2-py3-none-any.whl

Total release size: 8.4 kB

Release files / crouton_client-0.0.5.dev2.tar.gz

Download URL crouton_client-0.0.5.dev2.tar.gz
Size 3.5 kB
Tags Source
SHA-256 checksum
How to use checksums
90e4c576642ebebb409a7bbc7329a55b1be410636e898e40be35e5c6a79e68a2
BLAKE2b-256 checksum
How to use checksums
2ffa1527ec748bb857d0ec6c71eede054bf8c6d414af58085026e7e227068a8f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.21

Release files / crouton_client-0.0.5.dev2-py3-none-any.whl

Download URL crouton_client-0.0.5.dev2-py3-none-any.whl
Size 4.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2e9e8f23980dc15a4b92a16e5f9b5b6a03cc0481dae87b9968d711613d1d75a9
BLAKE2b-256 checksum
How to use checksums
ea03e6b7dea5597761d03ce477517eb56cb679de4b76547e6c2c84bf4a549e70
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.21

Security for crouton-client 0.0.5.dev2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page