Helpful decorators for the requests library. Allows you to return typed REST responses.
Project description
Can I Get A (canigeta)
canigeta makes getting typed REST responses via the requests library easy.
Example
# Simple example of a typed return from a REST endpoint
# This endpoint returns {'message': 'Hello, World!'} JSON.
from dataclasses import dataclass
import requests
from canigeta import response
@dataclass
class HelloData:
message: str
@response.as_type(HelloData)
def get_hello() :
return requests.get(url = "http://127.0.0.1:5000")
# HelloData(message='Hello, World!')
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
canigeta-0.0.1.tar.gz
(2.7 kB
view details)
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 canigeta-0.0.1.tar.gz.
File metadata
- Download URL: canigeta-0.0.1.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dde9776e546760b233a19494979e5e4099d7b01cc7c71eaf4be23aa589ec91e4
|
|
| MD5 |
bc51e7cb1ed3f79eb1f5bc3563b0d4ba
|
|
| BLAKE2b-256 |
8dab82a8adc513e540895c4a8ad54b81e7d23a04e02b1ffc00dbea46241bdba8
|
File details
Details for the file canigeta-0.0.1-py3-none-any.whl.
File metadata
- Download URL: canigeta-0.0.1-py3-none-any.whl
- Upload date:
- Size: 3.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c844604f6917860f36e812f6b4ede05dca3e05f2ccd0a9e3b6a75659acb23930
|
|
| MD5 |
33b43ba3a8d37fd80c37610faf0e670c
|
|
| BLAKE2b-256 |
ab9b2e51aa62efa755c2355345aa77975d68f81884a39f2c2589aa488e1f04ba
|