Skip to content

Overview: Aerospike Python client

For the complete documentation index see: llms.txt

All documentation pages available in markdown.

The Aerospike Python client is a production-ready, synchronous library for building applications on Aerospike Database. It exposes the full database feature set through a Pythonic API: single-record create, read, update, and delete (CRUD), atomic multi-bin operations, batch reads and writes, indexed queries, user-defined functions (UDFs), and multi-record transactions.

Install with pip install aerospike. See Installation for supported Python and OS versions.

Feature highlights

Record operations:

  • CRUD and atomic updates: Create, read, update, and delete records, plus compound bin operations in a single round trip.
  • Expressions: Attach filter expressions to reads and writes for conditional execution.
  • Document model: Store and query JSON-like documents using Map bins and secondary indexes on nested values.

Query and scan:

Multi-record operations:

  • Batch protocol: Combine reads, writes, deletes, and exists checks in batched commands.
  • Transactions: Group create, update, read, and delete steps in multi-record transactions (Database 8.0.0.0 and later).

Server-side logic:

Operations and observability:

  • Policies: Tune timeouts, retries, consistency, and write behavior with client policies.
  • Metrics: Collect standard and extended client metrics programmatically or through Dynamic Client Configuration (Python client 17.1.0 and later).
  • Security: Connect with username/password authentication and TLS. See Connecting.

Data types:

See the release notes for version history.

Developer SDK for Python

For new applications, Aerospike also offers the Developer SDK with a fluent Python API built on top of the classic client. The Developer SDK adds:

  • Chainable methods for upsert, query, batch, and delete operations
  • Aerospike Expression Language (AEL) queries with readable filter strings
  • Typed errors with recovery suggestions

Install with pip install aerospike-sdk and follow the Developer SDK quickstart.

Ready to get started?

Installation

Install the client with pip and verify your Python and Aerospike Database versions.

Installation →

Policies

Configure timeouts, retries, consistency modes, and write behavior for your workload.

Policies →

Error handling

Handle AerospikeError exceptions and interpret server result codes in your application.

Error handling →

Feedback

Was this page helpful?

What type of feedback are you giving?

What would you like us to know?

+Capture screenshot

Can we reach out to you?