Skip to main content

Professional asynchronous HTTP client for Python — interceptors, progress tracking, FormData, Blob, concurrent requests, connection pooling, retry mechanism, and full type hints

Project description

AtomHTTP Logo

AtomHTTP

A professional, feature-rich asynchronous HTTP client for Python — designed for developers who need reliability, flexibility, and performance.

Full Documentation — Complete API reference, advanced guides, and examples


Features

  • Full HTTP Method Support: GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS with async/await syntax
  • Request & Response Interceptors: Modify requests before sending and responses before returning
  • Upload & Download Progress Tracking: Real-time callbacks for monitoring data transfer
  • FormData Support: Multipart/form-data and URL-encoded form handling with file uploads
  • Multiple Response Types: JSON (auto-parsed), text, blob, arraybuffer, and stream
  • Concurrent Request Helpers: Execute multiple requests in parallel with all() and spread()
  • Base URL Configuration: Set a base URL once and use relative paths
  • Automatic JSON Serialization: No need to manually encode/decode JSON
  • Authentication: Basic Auth and Bearer Token support
  • Comprehensive Error Handling: Typed exceptions with standardized error codes
  • Timeout & Redirect Control: Configurable timeouts and maximum redirect limits
  • Keep-Alive & Connection Pooling: Reuse connections for better performance
  • Proxy Support: Route requests through HTTP proxies
  • Unix Socket Path Support: Connect via Unix domain sockets
  • Size Limits: Configure maximum request body and response content lengths
  • Status Code Validation: Custom validation functions for HTTP status codes
  • CSRF Protection: Built-in support for XSRF token headers
  • Automatic Decompression: Handles gzip and deflate compressed responses
  • Mock Adapter for Testing: Simulate responses without network calls
  • Type Hints: Full typing support for excellent IDE autocompletion

Installation

pip install atomhttp

With development dependencies:

pip install atomhttp[dev]

Quick Start

import asyncio
from atomhttp import AtomHTTP

async def main():
    client = AtomHTTP({'baseURL': 'https://api.example.com'})
    response = await client.get('/users')
    print(response.status, response.data)
    await client.close()

asyncio.run(main())

Documentation

For complete documentation, API reference, and advanced usage examples, visit:

https://inject3r.github.io/atomhttp

The documentation includes:

  • Detailed API reference for all classes and methods
  • Advanced usage patterns and best practices
  • Configuration options and their effects
  • Error handling strategies
  • Migration guides from other HTTP clients

Requirements

  • Python 3.8+
  • aiohttp 3.8.0+

Running Tests

# Run all tests with coverage
./scripts/tests.sh

# Clean test output files
./scripts/test_clean.sh

License

This project is licensed under the MIT License.

Author

Abolfazl Hosseini

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

Acknowledgments

  • aiohttp - Async HTTP client/server framework
  • All contributors and users of this project

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

atomhttp-1.2.4.tar.gz (44.6 kB view details)

Uploaded Source

Built Distribution

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

atomhttp-1.2.4-py3-none-any.whl (52.6 kB view details)

Uploaded Python 3

File details

Details for the file atomhttp-1.2.4.tar.gz.

File metadata

  • Download URL: atomhttp-1.2.4.tar.gz
  • Upload date:
  • Size: 44.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for atomhttp-1.2.4.tar.gz
Algorithm Hash digest
SHA256 06c848ce5a92f54464cb675be547d9cb17d0966740996d38ba26d4a331d5b600
MD5 a19de2fdd349ed4094b93637bed8882a
BLAKE2b-256 ef8e7a208d5833fdd176ad570b847128f4b366f4699b65eb9255ff8235b52e1c

See more details on using hashes here.

File details

Details for the file atomhttp-1.2.4-py3-none-any.whl.

File metadata

  • Download URL: atomhttp-1.2.4-py3-none-any.whl
  • Upload date:
  • Size: 52.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for atomhttp-1.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 fbf4af635f10ecbe401e91822f3d78915d6fb5dcc199e4e6582fc2dea1599469
MD5 295bd6b59bc58c1ef483d746275bdb4e
BLAKE2b-256 e4480215e2372777c83d31aba20ec9bd2b0a51b85900fe8c9ae54dbc00fab528

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