Async FastAPI-style wrapper
Project description
oxius
Ultra-fast, dependency-free async HTTP client for Python. A drop-in alternative to aiohttp with minimal footprint.
Features
- Fully async with asyncio
- HTTP methods: GET, POST, PUT, DELETE, HEAD, OPTIONS
- SQLite response caching with TTL
- Zero external dependencies
- Clean, simple API
Installation
pip install oxius
Quick Start
import asyncio
import oxius
async def main():
session = oxius.ClientSession()
response = await session.get("https://catfact.ninja/fact")
print(response.json())
asyncio.run(main())
Usage
import asyncio
import oxius
async def example():
session = oxius.ClientSession()
# GET request
response = await session.get("https://api.github.com/users/octocat")
# POST with body
post_response = await session.post(
"https://httpbin.org/post",
body='{"key": "value"}',
headers={"Content-Type": "application/json"}
)
print(f"Status: {response.status}")
print(f"Data: {response.json()}")
asyncio.run(example())
API
Methods
session.get(url, headers=None)session.post(url, headers=None, body=None)session.put(url, headers=None, body=None)session.delete(url, headers=None)session.head(url, headers=None)session.options(url, headers=None)
Response
response.status- HTTP status coderesponse.json()- Parse JSON responseresponse.text()- Get response as textresponse.headers- Response headers
License
MIT License
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
oxius-1.0.1.tar.gz
(4.6 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
oxius-1.0.1-py3-none-any.whl
(6.1 kB
view details)
File details
Details for the file oxius-1.0.1.tar.gz.
File metadata
- Download URL: oxius-1.0.1.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c3d6598b5710e8ffff0be3481bbc9172a74e4097ba09133c0ddda39e1d0ced9
|
|
| MD5 |
69a56018c2d07e94cc60bf1d6b60f315
|
|
| BLAKE2b-256 |
13b7f198fae58ff3a29f0f89648ab65dcfa1e598a3293ec790578d24112930ae
|
File details
Details for the file oxius-1.0.1-py3-none-any.whl.
File metadata
- Download URL: oxius-1.0.1-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fd97124573c4757350da3cfc90539b5c26f64f234dbe4e860329a968bfdbe15a
|
|
| MD5 |
7aab838683364c7be057c3f22bdda894
|
|
| BLAKE2b-256 |
dbd3c8cdcf5601fba3fed7b724833a13b208b26216f1c845e50c4a17b3e9bdd9
|