Getting Started
Everything you need to start making HTTP requests with AtomHTTP
Why AtomHTTP?
AtomHTTP is a modern asynchronous HTTP client for Python that combines the best features from popular libraries while adding unique capabilities like progress tracking, interceptors, and full type hints.
AtomHTTP is a modern, feature-rich asynchronous HTTP client designed for Python developers who need reliability, flexibility, and performance.
With comprehensive built-in features including interceptors, progress tracking, multiple response types (JSON, text, blob, arraybuffer, stream), FormData support, concurrent request helpers, and thorough error handling with standardized error codes — AtomHTTP provides everything you need for production-grade HTTP communication.
Installation
Install AtomHTTP using pip. The library has minimal dependencies and works with Python 3.8 and above.
Basic installation:Minimal setup for production use
pip install atomhttpWith development dependencies:Includes pytest, black, mypy, ruff for development
pip install atomhttp[dev]With testing dependencies only:Only testing tools without linters
pip install atomhttp[test]Requires Python 3.8 or higher
Core dependency: aiohttp 3.8.0+ (automatically installed)
Quick Start
Create a client instance and start making requests in just a few lines of code.
Basic GET request:Simple request to fetch a single resource with automatic cleanup
import asyncio
from atomhttp import AtomHTTP
async def main():
async with AtomHTTP() as client:
response = await client.get('https://jsonplaceholder.typicode.com/posts/1')
print(f"Status: {response.status}")
print(f"Title: {response.data['title']}")
print(f"User ID: {response.data['userId']}")
asyncio.run(main())With configuration:Using baseURL, timeout, and default headers
import asyncio
from atomhttp import AtomHTTP
async def main():
client = AtomHTTP({
'baseURL': 'https://jsonplaceholder.typicode.com',
'timeout': 10,
'headers': {'Accept': 'application/json'}
})
response = await client.get('/posts', params={'_limit': 5})
for post in response.data:
print(f"Post {post['id']}: {post['title'][:50]}...")
await client.close()
asyncio.run(main())POST request with JSON:Creating a new resource
import asyncio
from atomhttp import AtomHTTP
async def main():
client = AtomHTTP({'baseURL': 'https://jsonplaceholder.typicode.com'})
new_post = await client.post('/posts', data={
'title': 'My Awesome Post',
'body': 'This is the content of my post',
'userId': 1
})
print(f"Created with ID: {new_post.data['id']}")
print(f"Status: {new_post.status}")
await client.close()
asyncio.run(main())System Requirements
AtomHTTP works on all major operating systems and has minimal requirements.
Python Version
- •3.8
- •3.9
- •3.10
- •3.11
- •3.12
- •3.13
Operating Systems
- •Windows 10/11
- •macOS (Intel + Apple Silicon)
- •Linux (Ubuntu, Debian, CentOS, etc.)
- •WSL (Windows Subsystem for Linux)
Your First Request
Let's make a complete example that demonstrates the most common features.
import asyncio
from atomhttp import AtomHTTP
async def main():
# 1. Create client with configuration
client = AtomHTTP({
'baseURL': 'https://jsonplaceholder.typicode.com',
'timeout': 10,
'headers': {
'Accept': 'application/json',
'User-Agent': 'AtomHTTP-Demo/1.0'
}
})
# 2. GET request with query parameters
print("Fetching posts...")
response = await client.get('/posts', params={'_limit': 3})
print(f"Status: {response.status}")
print(f"Headers: {dict(list(response.headers.items())[:3])}")
for post in response.data:
print(f" Post {post['id']}: {post['title'][:40]}...")
# 3. POST request
print("\nCreating a new post...")
new_post = await client.post('/posts', data={
'title': 'Hello AtomHTTP!',
'body': 'This is my first request with AtomHTTP',
'userId': 1
})
print(f"Created with ID: {new_post.data['id']}")
print(f"Response status: {new_post.status}")
# 4. Clean up
await client.close()
print("\nDone!")
if __name__ == "__main__":
asyncio.run(main())Next Steps
Now that you've mastered the basics, explore more advanced features.
Core API →
HTTP methods, response handling, configuration, headers, parameters, and error handling
Advanced Features →
Interceptors, progress tracking, FormData, concurrent requests, and authentication
API Reference →
Complete API documentation, comparison charts, and examples
GitHub →
Source code, issues, contributions, and releases