API Reference

The Aerospike Python SDK is organized into three layers:

Async API

The primary API. All operations are async/await.

Class

Description

ClusterDefinition

Entry point — configure seeds/auth/TLS, then connect()

AsyncPool

Multi-loop async pool — N event loops × N cluster members for parallel async work (free-threaded Python)

Cluster

Live cluster connection returned by ClusterDefinition.connect()

Node

One server node: address, version, and per-node info commands

Session

Scoped reads and writes with a fixed Behavior

QueryBuilder

Build and execute read queries (point, set, batch)

WriteSegmentBuilder

Build and execute writes (upsert, insert, update, replace, delete)

RowWriteBuilder

Tabular writes: a bin schema, then one row per record

CdtReadBuilder

Read operations on list and map CDTs

CdtWriteBuilder

Write operations on list and map CDTs

StringOperation

Server-side string operation factory + flag types

IndexBuilder

Create and drop secondary indexes

BackgroundTaskSession

Server-side background jobs (update, delete, touch, UDF)

UdfFunctionBuilder

Foreground UDF execution

InfoCommands

Aerospike info protocol commands

TransactionalSession

Multi-record transactions

TxnStatus

Outcome of a transaction commit or abort

Sync API

Synchronous wrappers for the async API. Same functionality, no async/await.

Class

Description

ClusterDefinition

Sync entry point — configure, then connect()

Cluster

Sync cluster handle

Node

Sync server node view

Session

Sync session

QueryBuilder

Sync query builder

WriteSegmentBuilder

Sync write builder (upsert, insert, update, replace, delete)

RowWriteBuilder

Sync tabular writes

IndexBuilder

Sync secondary index builder

BackgroundTaskSession

Sync server-side background jobs

UdfFunctionBuilder

Sync foreground UDF execution

InfoCommands

Sync info protocol commands

TransactionalSession

Sync multi-record transactions

RecordStream

Sync iterator over query results

Core

Shared types used by both async and sync APIs.

Class

Description

DataSet

Namespace + set pair, key factory

HllConfig

HyperLogLog bin precision (index + minhash bit counts)

SortedMap

Declares a map bin key-ordered on a plain write

RecordResult

Single result from a query or batch

OperationResult

Typed-accessor wrapper around a single operation’s value

RecordStream

Async iterator over query results

Behavior

Policy presets (timeouts, consistency)

ClusterDefinition

Cluster connection configuration

SystemSettings

Global system-level tunables

ErrorStrategy

Error handling strategies

Exceptions

Exception hierarchy

ExpressionTrace

Structured expression build trace on AerospikeError (verbosity 3)

QueryHint

Query optimization hints

Metrics

Metrics policy, snapshot, and derived latency views

SdkLoggers

Stable logger names for operator tuning

Expressions

Class / Function

Description

Exp

Programmatic expression builder

String AEL for .where() is compiled on the server (field 43) — see the AEL guide.