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.2.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.2-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: oxius-1.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 1d88abb8f6b48e46cdb4cd017f3f83ad0b0f540f903e8cf5c2f1e952c1009266
MD5 51375480fb6950a81cbf9927a8ac1b7c
BLAKE2b-256 620c7bea4c2f2f82d381a075be45350255e449274a50d74b3de34d6e747fad84

See more details on using hashes here.

File details

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

File metadata

  • Download URL: oxius-1.0.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 23d611c8acab3bf2027fe0540c5c5c14cbfd1e9ac1433879d60f6a74942e728e
MD5 7189801593468425b8557fbeef44d328
BLAKE2b-256 c3bee3ac476bd96bd60534ba7da9eea218269922fff9497e685cc2a2043721cb

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