Skip to main content

Async FastAPI-style wrapper

Project description

oxius

Python License PyPI

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 code
  • response.json() - Parse JSON response
  • response.text() - Get response as text
  • response.headers - Response headers

License

MIT License

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

oxius-1.0.3.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

oxius-1.0.3-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file oxius-1.0.3.tar.gz.

File metadata

  • Download URL: oxius-1.0.3.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

Hashes for oxius-1.0.3.tar.gz
Algorithm Hash digest
SHA256 e7caa35395a455c9424b59688e8e2e6286ad7c72d430c0b9dc6911f3bf978d54
MD5 46adc777970dd5539d774d20cdf37b86
BLAKE2b-256 8eda48fdd2a7db8630a30d7a109608265ebd6ff794ab0d9746c6dcbe9781e2ef

See more details on using hashes here.

File details

Details for the file oxius-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: oxius-1.0.3-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

Hashes for oxius-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 578bd25957e6876d035994d4dec7414b6cca7ac681597791c4e9a8f14976287b
MD5 e75d38a1e82eccaea8ac299d4ea900db
BLAKE2b-256 c821c2cd33e82a760bbfcf9dba6b592487d7e31ec500508c8ff44fa04cadeb96

See more details on using hashes here.

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