Why aerospike-py?
Built for production workloads where every millisecond counts
🦀
Rust Performance
Native binary via PyO3 — zero Python overhead on the hot path.
⚡
Sync & Async
Both Client and AsyncClient. Works with FastAPI, Django, Gunicorn, and more.
📦
Zero Python Deps
Ships as a compiled wheel. No native C extensions to install separately.
🔍
Full Type Hints
PEP 561 compliant with bundled .pyi stubs. First-class IDE auto-complete.
🔢
NumPy Support
Batch results directly as NumPy arrays — ideal for analytics workloads.
Sync & Async Support
Use Client for synchronous workloads or AsyncClient for async frameworks like FastAPI, Starlette, and Django Channels — same API, both fully supported.
- SyncClient
- AsyncClient
from aerospike_py import Client
client = Client({'hosts': [('localhost', 3000)]})
client.connect()
client.put(('test','demo','key1'), {'name': 'Alice', 'age': 30})
_, _, bins = client.get(('test','demo','key1'))
print(bins) # {'name': 'Alice', 'age': 30}
client.close()
import asyncio
from aerospike_py import AsyncClient
async def main():
client = AsyncClient({'hosts': [('localhost', 3000)]})
await client.connect()
await client.put(('test','demo','key1'), {'name': 'Alice', 'age': 30})
_, _, bins = await client.get(('test','demo','key1'))
print(bins) # {'name': 'Alice', 'age': 30}
await client.close()
asyncio.run(main())