Gefest Simple REST Client
Description
Gefest Simple REST Client is a library designed to simplify the creation of REST API clients in Python. Built on httpx, it provides both synchronous and asynchronous API interaction.
Features
- 🛠️ Abstraction of clients and endpoints
- ⚙️ Support for both synchronous (
httpx.Client) and asynchronous (httpx.AsyncClient) request models - ✅ Dynamic access to endpoints
- ✨ URL templates for handling path parameters
Installation
pip install gefest_simple_rest_client
Usage Example
from gefest_simple_rest_client.client import BaseClient
from gefest_simple_rest_client.endpoint import BaseEndpoint, PathTemplate
class MyEndpoint(BaseEndpoint):
name = "example"
path_template = PathTemplate("/example/{id:int}")
class MyClient(BaseClient):
base_url = "https://api.example.com"
headers = {"Authorization": "Bearer YOUR_TOKEN"}
endpoints = [MyEndpoint]
client = MyClient()
Synchronous Usage
response = client.example.get(path_params={"id": 123})
print(response.json())
Asynchronous Usage
import asyncio
async def fetch():
async with MyClient() as client:
response = await client.example.get_async(path_params={"id": 123})
print(response.json())
asyncio.run(fetch())
Errors when Passing Invalid Path Parameters
If incorrect parameters are provided, exceptions are raised:
try:
response = client.example.get(path_params={"id": "invalid_string"})
except Exception as e:
print(f"Error: {e}")
Example error:
PathParamsValidationError: Parameter 'id' must be of type int
Feedback
If you have any questions or suggestions, feel free to reach out via GitHub Issues.
Metadata
Release files for gefest-simple-rest-client 1.2025.3.16
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| gefest_simple_rest_client-1.2025.3.16.tar.gz | 8.1 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gefest_simple_rest_client-1.2025.3.16-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.9 kB
Release files / gefest_simple_rest_client-1.2025.3.16.tar.gz
| Download URL | gefest_simple_rest_client-1.2025.3.16.tar.gz |
|---|---|
| Size | 8.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
40df3d83c623330778e73f25b8febf3b76ae2b2ea2a3eb9bb98a7f8c8f2491c6
|
|
BLAKE2b-256 checksum How to use checksums |
5dd3c478c8a958dfc91f042bf592883c102bc31d637be6e15ab49ce40180ec30
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.21
|
Release files / gefest_simple_rest_client-1.2025.3.16-py3-none-any.whl
| Download URL | gefest_simple_rest_client-1.2025.3.16-py3-none-any.whl |
|---|---|
| Size | 9.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
af82a5fa266eeb096f5e80b8b61c20792aff113a6881670f5292277a58707b90
|
|
BLAKE2b-256 checksum How to use checksums |
1925f6e564fc21f8f32046f15e837ca4af68ae6eb59de9360abe5c1742a7e06b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.21
|
Security for gefest-simple-rest-client 1.2025.3.16
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.