Professional asynchronous HTTP client for Python — interceptors, progress tracking, FormData, Blob, concurrent requests, connection pooling, retry mechanism, and full type hints
Project description
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()andspread() - 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
- Email: tryuzr@gmail.com
- GitHub: @inject3r
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - 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
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
File details
Details for the file atomhttp-1.2.2.tar.gz.
File metadata
- Download URL: atomhttp-1.2.2.tar.gz
- Upload date:
- Size: 44.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5635dbb315d0eb8a7e835c308025042e5b3eeb2e3ca9f1a0ed9761ca38626ee4
|
|
| MD5 |
f90bd7fd738e835f2b4595cc2fcee970
|
|
| BLAKE2b-256 |
8489c233c558432704a5949fb8404a5c7cb57ad9badbc5af7bbfb81a25628c13
|
File details
Details for the file atomhttp-1.2.2-py3-none-any.whl.
File metadata
- Download URL: atomhttp-1.2.2-py3-none-any.whl
- Upload date:
- Size: 52.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f85030e0f37ac51681600c4d1ff3d6f1bb2b25fddd2905b3260d92d661442e31
|
|
| MD5 |
d2c1cb999666f58979cb30a9794f639f
|
|
| BLAKE2b-256 |
5338034e8ff84a283a328bbf945ad674817c1c5ed2b46edc8b19e236498c5f87
|