Skip to main content

areq

PyPI version Python Versions License: MIT codecov

areq is an asynchronous drop-in replacement for the popular requests library. It provides the same familiar API as requests but with async/await support, making it perfect for modern Python applications that need to make HTTP requests efficiently.

Features

  • 🚀 Async by Default: Built on top of httpx for modern async/await support
  • 🔄 Drop-in Replacement: Compatible with requests API, making migration easy
  • 🛠 Type Hints: Full type support for better IDE integration and code safety
  • 📦 Lightweight: Minimal dependencies, just httpx and requests

Installation

pip install areq

Quick Start

import areq

# Async GET request
async def fetch_data():
    response = await areq.get("https://api.example.com/data")
    return response.json()

# Async POST request with JSON
async def create_item():
    data = {"name": "example", "value": 123}
    response = await areq.post("https://api.example.com/items", json=data)
    return response.json()

API Reference

areq provides the same methods as requests:

  • areq.get(url, **kwargs)
  • areq.post(url, **kwargs)
  • areq.put(url, **kwargs)
  • areq.delete(url, **kwargs)
  • areq.head(url, **kwargs)
  • areq.options(url, **kwargs)
  • areq.patch(url, **kwargs)
  • areq.request(method, url, **kwargs)

All methods are async and return an areq.AreqResponse object, which is compatible with requests.Response.

Response Object

The response object provides the same interface as requests.Response:

response = await areq.get("https://api.example.com/data")

# Access response data
print(response.status_code)  # HTTP status code
print(response.headers)      # Response headers
print(response.text)         # Response body as text
print(response.json())       # Parse JSON response
print(response.content)      # Raw response content

Advanced Usage

Custom Headers

headers = {"Authorization": "Bearer token123"}
response = await areq.get("https://api.example.com/data", headers=headers)

Query Parameters

params = {"page": 1, "limit": 10}
response = await areq.get("https://api.example.com/items", params=params)

File Upload

files = {"file": open("document.pdf", "rb")}
response = await areq.post("https://api.example.com/upload", files=files)

Timeout

response = await areq.get("https://api.example.com/data", timeout=5.0)

Migration from requests

If you're using requests, migrating to areq is straightforward:

# Before (requests)
import requests
response = requests.get("https://api.example.com/data")
data = response.json()

# After (areq)
import areq
async def get_data():
    response = await areq.get("https://api.example.com/data")
    data = response.json()

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Author

Ganesh Palanikumar - @ganeshpkumar93

Metadata

Release files for areq 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for areq 0.0.5
File Size Uploaded
areq-0.0.5.tar.gz 11.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for areq 0.0.5
File Interpreter ABI Platform
areq-0.0.5-py3-none-any.whl Python 3 none any Details

Total release size: 20.0 kB

Release files / areq-0.0.5.tar.gz

Download URL areq-0.0.5.tar.gz
Size 11.5 kB
Tags Source
SHA-256 checksum
How to use checksums
42acfa489478fd2846555ead938106628b1c8fac479b2a2c07415bc4671c8e6b
BLAKE2b-256 checksum
How to use checksums
c8d12359dd7963869aed9a14d2fbc67e995d9c38d8a15a88779394197062c903
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 12, 2025.

Transparency log

Release files / areq-0.0.5-py3-none-any.whl

Download URL areq-0.0.5-py3-none-any.whl
Size 8.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
36fa8c96e4becc18151d03e6c9800e617455a716b4757a34f51d75ad477b9c67
BLAKE2b-256 checksum
How to use checksums
accee105e715e089781c76893a43688e8a04f94244077c31cabef3da4dc006b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 12, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.0.5 This release

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page