Registry / database / aerospike

aerospike

JSON →
library19.2.1pypypi✓ verified 85d ago

aerospike is a package which provides a Python client for Aerospike database clusters. The client enables applications to interact with Aerospike, managing connections and handling database operations like CRUD, queries, and scans. It is a CPython module built on the Aerospike C client. The current version is 19.2.0, and the library maintains an active release cycle with frequent updates and major version increments.

pip install aerospike
INSTALL
IMPORT
SIG · AEROSPIKE
A
aerospike
databasepythonv19.2.1
Install
1.8s avg
Import
113ms
Disk
33MB
Pass rate
4/ 10
Env Coverage4 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v19.2.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✕ build_error
✓ 1.8s
py 3.11
✕ build_error
✓ 1.85s
py 3.12
✕ build_error
✓ 1.68s
py 3.13
✕ build_error
✓ 1.75s
py 3.9
✕ build_error
✕ build_error
33MB installed
● package 33MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

aerospike
import aerospike
Client
client = aerospike.client(config)
The `aerospike.client()` function acts as a constructor for the Client class and connects to the cluster upon instantiation.

This quickstart demonstrates how to connect to an Aerospike cluster, write a record with a key and bins, read the record, update a bin, and finally close the client connection. It assumes an Aerospike database is running on localhost:3000.

import aerospike import sys # Configure the client to connect to a local Aerospike cluster config = { 'hosts': [ ('127.0.0.1', 3000) ] } try: # Create a client object and connect to the cluster client = aerospike.client(config).connect() except aerospike.exception.ClientError as e: print(f"Error: Failed to connect to Aerospike cluster: {e}", file=sys.stderr) sys.exit(1) # Define a key: (namespace, set, userkey) key = ('test', 'demo', 'my_key_1') # Define record bins (data) bins = { 'name': 'John Doe', 'age': 32 } try: # Write a record client.put(key, bins) print(f"Record written: {key}") # Read the record back (key_read, metadata_read, record_read) = client.get(key) print(f"Record read: {record_read}") # Update a bin client.put(key, {'age': 33}) print(f"Record updated: {key}") (key_updated, metadata_updated, record_updated) = client.get(key) print(f"Record after update: {record_updated}") except aerospike.exception.AerospikeError as e: print(f"Aerospike Error: {e}", file=sys.stderr) sys.exit(1) finally: # Close the connection to the Aerospike cluster if client: client.close() print("Client connection closed.")
Debug
Known issues
breakingAerospike Python client 5.0.0 and up requires Aerospike server 4.9 or later. Attempting to connect to older server versions will result in a '-10, Failed to connect' error.
fix
Ensure your Aerospike server version is 4.9 or newer before upgrading the Python client.
affects: >= 5.0.0
breakingSupport for older Python versions is periodically removed. Python 3.5 support was removed in client 6.0.0. Python 3.8 and 3.9 support was removed in recent major versions (e.g., Python 3.9 in 19.0.0).
fix
Always check the official documentation for the supported Python range. The current client (19.x.x) supports Python 3.10 - 3.14.
affects: Varies by version, Python 3.5 removed in 6.0.0, 3.8/3.9 removed in later major versions (e.g. 19.0.0)
deprecatedDirect instantiation of `aerospike.Scan()` and `aerospike.Query()` objects is deprecated. These methods now issue a warning and will raise an exception in future major releases.
fix
Use `client.scan()` and `client.query()` methods on an `aerospike.Client` instance instead.
affects: >= 18.1.0
deprecatedThe `info_node()` method was deprecated and will no longer work when security is enabled due to client authentication changes.
fix
Use `info_single_node()` instead.
affects: >= 6.0.0
gotchaPassing a non-integer value as a port number in a host tuple to `aerospike.client()` currently issues a warning but will raise a `ParamError` exception in the next major client release.
fix
Ensure all port numbers in the host configuration are integers.
affects: >= 18.0.0
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'aerospike'
The Aerospike Python client is not installed in the current Python environment.
fix
Install the Aerospike client using pip: `pip install aerospike`.
AttributeError: 'module' object has no attribute 'client'
The script is named 'aerospike.py', causing a conflict with the Aerospike module import.
fix
Rename the script to avoid naming conflicts, e.g., 'aerospike_test.py'.
AttributeError: 'aerospike.Client' object has no attribute 'info_all'
The method 'info_all' does not exist in the Aerospike Python client.
fix
Use the correct method 'info' instead: `client.info('sets')`.
aerospike.exception.ClientError: (-10, 'Failed to connect')
The Python client failed to establish a connection to the Aerospike cluster. Common causes include incorrect host/port configuration, the Aerospike server not running, network connectivity issues (e.g., firewall), or an incompatibility between client and server versions (e.g., Python client 5.0.0+ requires Aerospike server 4.9+).
fix
1. Verify the `hosts` (IP address and port, typically 3000) in your client configuration. 2. Ensure the Aerospike server is running and accessible from the client machine. 3. Check firewall rules blocking the connection. 4. If using Python client version 5.0.0 or newer, ensure your Aerospike server is version 4.9 or later.
Upgrade
Version history
19.2.1latest on PyPI · released Apr 20, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
44 hits · last 30 days
node
36
OpenAI (training)
1
Resources
aerospike — pip install aerospike · libregistry