Skip to main content
Version: main

API Comparison

A comprehensive comparison between the official C-based client (aerospike on PyPI) and aerospike-py (Rust-based). For migration steps, see the Migration Guide.

Connection

OperationOfficial C Clientaerospike-pyNotes
Createaerospike.client(config)aerospike_py.client(config)Same pattern
Connect.connect().connect()Same; returns self
Connect (auth).connect("user", "pass").connect("user", "pass")Same
Closeclient.close()client.close()Same
Is connectedclient.is_connected()client.is_connected()Same
Context managerN/Awith client: ...New in aerospike-py
Async clientN/AAsyncClient(config)New in aerospike-py

CRUD Operations

OperationOfficial C Clientaerospike-pyNotes
Putclient.put(key, bins, meta, policy)client.put(key, bins, meta, policy)Same
Get(key, meta, bins) = client.get(key)record = client.get(key)Returns Record NamedTuple; tuple unpacking still works
Select(key, meta, bins) = client.select(key, bins)record = client.select(key, bins)Returns Record NamedTuple
Exists(key, meta) = client.exists(key)result = client.exists(key)Returns ExistsResult NamedTuple
Removeclient.remove(key)client.remove(key)Same
Touchclient.touch(key)client.touch(key, val)Same; val sets new TTL
Appendclient.append(key, bin, val)client.append(key, bin, val)Same
Prependclient.prepend(key, bin, val)client.prepend(key, bin, val)Same
Incrementclient.increment(key, bin, offset)client.increment(key, bin, offset)Same
Remove binclient.remove_bin(key, bin_names)client.remove_bin(key, bin_names)Same
Operateclient.operate(key, ops)client.operate(key, ops)Same; returns Record
Operate orderedclient.operate_ordered(key, ops)client.operate_ordered(key, ops)Same; returns OperateOrderedResult

Batch Operations

OperationOfficial C Clientaerospike-pyNotes
Batch getclient.get_many(keys)client.batch_read(keys)Method renamed; returns BatchRecords
Batch existsclient.exists_many(keys)client.batch_read(keys, bins=[])Use empty bins list for existence check
Batch selectclient.select_many(keys, bins)client.batch_read(keys, bins=bins)Unified under batch_read
Batch operateclient.batch_operate(keys, ops)client.batch_operate(keys, ops)Same; official client uses aerospike_helpers
Batch removeclient.batch_remove(keys)client.batch_remove(keys)Same; official client uses aerospike_helpers
Batch read (NumPy)N/Aclient.batch_read(keys, _dtype=dt)New in aerospike-py
Batch write (NumPy)N/Aclient.batch_write_numpy(data, ...)New in aerospike-py

Query and Scan

OperationOfficial C Clientaerospike-pyNotes
Create queryclient.query(ns, set)client.query(ns, set)Same
Query selectquery.select("bin1", "bin2")query.select("bin1", "bin2")Same
Query wherequery.where(predicate)query.where(predicate)Same
Query resultsquery.results()query.results()Same
Query foreachquery.foreach(callback)query.foreach(callback)Same
Scanclient.scan(ns, set)N/ADeprecated -- use query() without where()

Secondary Index

OperationOfficial C Clientaerospike-pyNotes
Create integer indexclient.index_integer_create(ns, set, bin, name)client.index_integer_create(ns, set, bin, name)Same
Create string indexclient.index_string_create(ns, set, bin, name)client.index_string_create(ns, set, bin, name)Same
Create geo indexclient.index_geo2dsphere_create(ns, set, bin, name)client.index_geo2dsphere_create(ns, set, bin, name)Same
Remove indexclient.index_remove(ns, name)client.index_remove(ns, name)Same

UDF (User-Defined Functions)

OperationOfficial C Clientaerospike-pyNotes
Register UDFclient.udf_put(filename)client.udf_put(filename)Same
Remove UDFclient.udf_remove(module)client.udf_remove(module)Same
Apply UDFclient.apply(key, module, function, args)client.apply(key, module, function, args)Same

Admin (User / Role Management)

OperationOfficial C Clientaerospike-pyNotes
Create userclient.admin_create_user(user, pw, roles)client.admin_create_user(user, pw, roles)Same
Drop userclient.admin_drop_user(user)client.admin_drop_user(user)Same
Change passwordclient.admin_change_password(user, pw)client.admin_change_password(user, pw)Same
Grant rolesclient.admin_grant_roles(user, roles)client.admin_grant_roles(user, roles)Same
Revoke rolesclient.admin_revoke_roles(user, roles)client.admin_revoke_roles(user, roles)Same
Query userclient.admin_query_user(user)client.admin_query_user_info(user)Method renamed
Query usersclient.admin_query_users()client.admin_query_users_info()Method renamed
Create roleclient.admin_create_role(role, privs)client.admin_create_role(role, privs)Same
Drop roleclient.admin_drop_role(role)client.admin_drop_role(role)Same
Grant privilegesclient.admin_grant_privileges(role, privs)client.admin_grant_privileges(role, privs)Same
Revoke privilegesclient.admin_revoke_privileges(role, privs)client.admin_revoke_privileges(role, privs)Same
Set whitelistN/Aclient.admin_set_whitelist(role, addrs)New in aerospike-py
Set quotasN/Aclient.admin_set_quotas(role, r, w)New in aerospike-py

Info / Cluster

OperationOfficial C Clientaerospike-pyNotes
Info all nodesclient.info_all(cmd)client.info_all(cmd)Same; returns list[InfoNodeResult]
Info random nodeclient.info_random_node(cmd)client.info_random_node(cmd)Same
Node namesclient.get_node_names()client.get_node_names()Same
Truncateclient.truncate(ns, set, nanos)client.truncate(ns, set, nanos)Same

Observability

FeatureOfficial C Clientaerospike-py
OpenTelemetry tracingN/Ainit_tracing() / shutdown_tracing()
Prometheus metricsN/Astart_metrics_server(port) / stop_metrics_server()
Log level controlN/Aset_log_level(level)

CDT Operations

ModuleOfficial C Clientaerospike-pyNotes
List operationsaerospike_helpers.operations.list_operationsaerospike_py.list_operations37 operations; same semantics
Map operationsaerospike_helpers.operations.map_operationsaerospike_py.map_operations33 operations; same semantics

Expression Filters

FeatureOfficial C Clientaerospike-pyNotes
Expression moduleaerospike_helpers.expressionsaerospike_py.exp60+ builder functions; same semantics
Usage in policiespolicy["expressions"] = expr.compile()policy["filter_expression"] = exprKey name differs; no .compile() needed

Key Differences Summary

AreaOfficial C Client (aerospike)aerospike-py
RuntimeC extension (CPython only)Rust + PyO3 (CPython only)
Return valuesPlain tuplesNamedTuple (tuple unpacking still works)
Async supportNoneAsyncClient with full API parity
NumPy integrationNonebatch_read with _dtype, batch_write_numpy
ObservabilityNoneOpenTelemetry tracing + Prometheus metrics
Context managerNonewith client: / async with client:
Scanclient.scan()Deprecated; use query() without where()
Exception namesTimeoutError, IndexErrorAerospikeTimeoutError, AerospikeIndexError (avoids shadowing builtins)
GeoJSON typeaerospike.GeoJSONNot yet available
Free-threaded PythonNot supportedSupported (3.14t)