# Python Client

**URL:** https://discuss.aerospike.com/c/client-libraries/python-client/16.md

[Latest](https://discuss.aerospike.com/latest.md) · [Categories](https://discuss.aerospike.com/categories.md) · [Tags](https://discuss.aerospike.com/tags.md)

---

## [Errors installing the Python client](https://discuss.aerospike.com/t/errors-installing-the-python-client/1337)

<div class="topic-metadata">

**Author:** [@rbotzer](https://discuss.aerospike.com/u/rbotzer)\
**Replies:** 1\
**Last updated:** [June 23, 2015, 6:14am UTC](https://discuss.aerospike.com/t/errors-installing-the-python-client/1337 "2015-06-23T06:14:30Z")

</div>

If you run into problems installing the Python client with pip, please create a new issue on the GitHub repository aerospike/aerospike-client-python.

---

## [About the Python Client category](https://discuss.aerospike.com/t/about-the-python-client-category/38)

<div class="topic-metadata">

**Author:** [@kporter](https://discuss.aerospike.com/u/kporter)\
**Replies:** 0

</div>

Discuss the Python client.

---

## [Python client not able to connect to aerospike](https://discuss.aerospike.com/t/python-client-not-able-to-connect-to-aerospike/12395)

<div class="topic-metadata">

**Author:** [@Allen\_Ryan](https://discuss.aerospike.com/u/Allen_Ryan)\
**Replies:** 0\
**Last updated:** [July 16, 2025, 9:32am UTC](https://discuss.aerospike.com/t/python-client-not-able-to-connect-to-aerospike/12395 "2025-07-16T09:32:25Z")

</div>

import aerospike import logging import ssl logging.basicConfig(level=logging.DEBUG, format="%(asctime)s.%(msecs)03d \[%(levelname)-7s\] - \[Pod: ss7psmf-1\] : %(message)s", datefmt="%Y-%m-%d %H:%M:%S") config = { "host…

---

## [Handling nulls in maps in expressions](https://discuss.aerospike.com/t/handling-nulls-in-maps-in-expressions/11129)

<div class="topic-metadata">

**Author:** [@smarkes](https://discuss.aerospike.com/u/smarkes)\
**Replies:** 5\
**Last updated:** [May 28, 2024, 8:36pm UTC](https://discuss.aerospike.com/t/handling-nulls-in-maps-in-expressions/11129 "2024-05-28T20:36:07Z")

</div>

I’ve got a problem handling maps with potential null values in expressions. Let’s say I have a bin "binName": { "key0": null, "key1": "value", } I want to create an expression which will check if key already ex…

---

## [Searching for the index of specific AAID](https://discuss.aerospike.com/t/searching-for-the-index-of-specific-aaid/11046)

<div class="topic-metadata">

**Author:** [@Yash\_Mulchandani](https://discuss.aerospike.com/u/Yash_Mulchandani)\
**Replies:** 1\
**Last updated:** [May 2, 2024, 4:46am UTC](https://discuss.aerospike.com/t/searching-for-the-index-of-specific-aaid/11046 "2024-05-02T04:46:42Z")

</div>

Hi Folks, We are trying to fetch the index of data from the list without using the Full Scan on the record we will be having the AAID and we have to fetch the index of only that userId currently it is giving the index in…

---

## [Error : Peers not reachable](https://discuss.aerospike.com/t/error-peers-not-reachable/10837)

<div class="topic-metadata">

**Author:** [@Yash\_Mulchandani](https://discuss.aerospike.com/u/Yash_Mulchandani)\
**Replies:** 1\
**Last updated:** [February 20, 2024, 10:21pm UTC](https://discuss.aerospike.com/t/error-peers-not-reachable/10837 "2024-02-20T22:21:44Z")

</div>

I have recently started using aerospike for my organisation, I’m trying to connect with aerospike client using python. here is my code import aerospike import settings import logging def main(): logging.basicConfi…

---

## [Get Aerospike hyperLogLog(HLL) intersection count of multiple HLL unions](https://discuss.aerospike.com/t/get-aerospike-hyperloglog-hll-intersection-count-of-multiple-hll-unions/10015)

<div class="topic-metadata">

**Author:** [@Sameer\_Darekar](https://discuss.aerospike.com/u/Sameer_Darekar)\
**Replies:** 20\
**Last updated:** [February 10, 2023, 6:44am UTC](https://discuss.aerospike.com/t/get-aerospike-hyperloglog-hll-intersection-count-of-multiple-hll-unions/10015 "2023-02-10T06:44:48Z")

</div>

Also posted to StackOverflow I have 2 or more HLLs that are unioned, I want to get the intersection count of that unions. I have used the example from here hll-python example Following is my code ops = \[hll\_ops.hll\_get…

---

## [Python pagination](https://discuss.aerospike.com/t/python-pagination/9632)

<div class="topic-metadata">

**Author:** [@Misutes](https://discuss.aerospike.com/u/Misutes)\
**Replies:** 6\
**Last updated:** [August 3, 2022, 10:56pm UTC](https://discuss.aerospike.com/t/python-pagination/9632 "2022-08-03T22:56:15Z")

</div>

Hi! I cant find a method which provide functionality for pagination. I use this syntax for select some bins from DB: scan = aerospike\_Client.scan(AEROSPIKE\_NAMESPACE, AEROSPIKE\_SET) results = scan.results(policy.compile…

---

## [Writing \`aerospike.null()\` to map doesn't remove item from map](https://discuss.aerospike.com/t/writing-aerospike-null-to-map-doesnt-remove-item-from-map/9367)

<div class="topic-metadata">

**Author:** [@avi](https://discuss.aerospike.com/u/avi)\
**Replies:** 1\
**Last updated:** [April 25, 2022, 7:14pm UTC](https://discuss.aerospike.com/t/writing-aerospike-null-to-map-doesnt-remove-item-from-map/9367 "2022-04-25T19:14:09Z")

</div>

repro with aerospike:ce-5.7.0.16, python 3.9.11 and python aerospike library 7.0.1 import aerospike from aerospike\_helpers.operations import map\_operations ac = aerospike.client({'hosts': \[('localhost', 3000)\]}) ac.con…

---

## [Client.get is not working if key is the map](https://discuss.aerospike.com/t/client-get-is-not-working-if-key-is-the-map/9344)

<div class="topic-metadata">

**Author:** [@Gajendra88](https://discuss.aerospike.com/u/Gajendra88)\
**Replies:** 1\
**Last updated:** [April 15, 2022, 7:04pm UTC](https://discuss.aerospike.com/t/client-get-is-not-working-if-key-is-the-map/9344 "2022-04-15T19:04:02Z")

</div>

Hi All, There are 2 scenerios, first scenerio it is working as expected but in second it is throwing an exception First Scenerio below is the data aql\> select \* from foo.test; ±-------±-----------±--------------------…

---

## [How to make expression evaluate to nil in order to delete bin](https://discuss.aerospike.com/t/how-to-make-expression-evaluate-to-nil-in-order-to-delete-bin/8978)

<div class="topic-metadata">

**Author:** [@avi](https://discuss.aerospike.com/u/avi)\
**Replies:** 5\
**Last updated:** [November 16, 2021, 8:23pm UTC](https://discuss.aerospike.com/t/how-to-make-expression-evaluate-to-nil-in-order-to-delete-bin/8978 "2021-11-16T20:23:34Z")

</div>

the docs mention aerospike.EXP\_WRITE\_ALLOW\_DELETE If expression results in nil value, then delete the bin. Otherwise, return OpNotApplicable when EXP\_WRITE\_POLICY\_NO\_FAIL is not set. how do we make an expression e…

---

## [Context within expressions not working as expected](https://discuss.aerospike.com/t/context-within-expressions-not-working-as-expected/8951)

<div class="topic-metadata">

**Author:** [@avi](https://discuss.aerospike.com/u/avi)\
**Replies:** 2\
**Last updated:** [November 10, 2021, 2:12am UTC](https://discuss.aerospike.com/t/context-within-expressions-not-working-as-expected/8951 "2021-11-10T02:12:35Z")

</div>

here is a reproduction using python 3.9 and client version 6.0.0 import aerospike from aerospike\_helpers import cdt\_ctx, expressions from aerospike\_helpers.operations import expression\_operations ac = aerospike.client(…

---

## [Multiple ops on same bin of a record](https://discuss.aerospike.com/t/multiple-ops-on-same-bin-of-a-record/8793)

<div class="topic-metadata">

**Author:** [@abhinavkulkarni](https://discuss.aerospike.com/u/abhinavkulkarni)\
**Replies:** 1\
**Last updated:** [September 6, 2021, 6:15pm UTC](https://discuss.aerospike.com/t/multiple-ops-on-same-bin-of-a-record/8793 "2021-09-06T18:15:33Z")

</div>

Hi, Is there a way to submit multiple operations on the same bin of a record and return two different values? For e.g., let us say I have a set academics with a Map field students that stores score =\> studentId mapping…

---

## [Async Python Library](https://discuss.aerospike.com/t/async-python-library/6900)

<div class="topic-metadata">

**Author:** [@aviramha](https://discuss.aerospike.com/u/aviramha)\
**Replies:** 1\
**Last updated:** [June 7, 2021, 8:55am UTC](https://discuss.aerospike.com/t/async-python-library/6900 "2021-06-07T08:55:20Z")

</div>

Hi. I’m working on an async Aerospike client library. It’s very basic right now and I develop it on my free time but I have great plans for it. The major obstacle I’m facing is developing and running tests against Enter…

---

## [Append bytes](https://discuss.aerospike.com/t/append-bytes/8161)

<div class="topic-metadata">

**Author:** [@avi](https://discuss.aerospike.com/u/avi)\
**Replies:** 9\
**Last updated:** [March 1, 2021, 5:11pm UTC](https://discuss.aerospike.com/t/append-bytes/8161 "2021-03-01T17:11:13Z")

</div>

is there any way to append bytes without a udf? i would expect something like this to work (using python client 4.0.0) import aerospike ac = aerospike.client({'hosts': \[('localhost', 3000)\]}) ac.connect() key = ('test'…

---

## [Python code slow (10 seconds) vs go code fast (1 second) - help?](https://discuss.aerospike.com/t/python-code-slow-10-seconds-vs-go-code-fast-1-second-help/7987)

<div class="topic-metadata">

**Author:** [@Nadav\_Kremer](https://discuss.aerospike.com/u/Nadav_Kremer)\
**Replies:** 1\
**Last updated:** [November 7, 2020, 3:25pm UTC](https://discuss.aerospike.com/t/python-code-slow-10-seconds-vs-go-code-fast-1-second-help/7987 "2020-11-07T15:25:47Z")

</div>

Hi all, We are working with python and we want to start using aerospike. With the help of Aerospike we came up with a python code and go code that basically does the same but the python code is much much slower. Is there…

---

## [Aerospike learning - writing many keys slow performance](https://discuss.aerospike.com/t/aerospike-learning-writing-many-keys-slow-performance/7932)

<div class="topic-metadata">

**Author:** [@Yechiel\_Levi](https://discuss.aerospike.com/u/Yechiel_Levi)\
**Replies:** 9\
**Last updated:** [October 28, 2020, 12:45am UTC](https://discuss.aerospike.com/t/aerospike-learning-writing-many-keys-slow-performance/7932 "2020-10-28T00:45:36Z")

</div>

Hi, We are considering Aerospike and trying to migrate but performance seems very problematic for us at the moment, since Aerospike is considered such a strong db i believe its something that we do wrong. We use the py…

---

## [Python client LIST\_WRITE\_ADD\_UNIQUE policy flag usage](https://discuss.aerospike.com/t/python-client-list-write-add-unique-policy-flag-usage/7823)

<div class="topic-metadata">

**Author:** [@dfinnegan](https://discuss.aerospike.com/u/dfinnegan)\
**Replies:** 2\
**Last updated:** [September 17, 2020, 10:42am UTC](https://discuss.aerospike.com/t/python-client-list-write-add-unique-policy-flag-usage/7823 "2020-09-17T10:42:32Z")

</div>

Trying to configure a write policy with LIST\_WRITE\_ADD\_UNIQUE to ensure only unique values get added to a bin list, but can’t seem to figure out the correct syntax. Have tried adding to a policy: policy = { 'map\_…

---

## [Is the Python client thread safe?](https://discuss.aerospike.com/t/is-the-python-client-thread-safe/7842)

<div class="topic-metadata">

**Author:** [@cloudrave](https://discuss.aerospike.com/u/cloudrave)\
**Replies:** 2\
**Last updated:** [September 16, 2020, 5:50pm UTC](https://discuss.aerospike.com/t/is-the-python-client-thread-safe/7842 "2020-09-16T17:50:13Z")

</div>

Does anyone know if the Python client is thread safe? Can multiple threads make requests with the client concurrently? I see the Java client advertises this feature, but the Python client does not, so I’d like to doubl…

---

## [Get node/cluster name from INFO\_NODE](https://discuss.aerospike.com/t/get-node-cluster-name-from-info-node/7666)

<div class="topic-metadata">

**Author:** [@Abhishek\_Kumar](https://discuss.aerospike.com/u/Abhishek_Kumar)\
**Replies:** 2\
**Last updated:** [July 31, 2020, 1:25am UTC](https://discuss.aerospike.com/t/get-node-cluster-name-from-info-node/7666 "2020-07-31T01:25:55Z")

</div>

Using INFO\_NODE we are looking to build an UI interface to display something like (i net statistics) below. how to get Node Name and cluster name ? Network Information (2018-03-02 08:28:09 UTC)~~~~~~~~~~~~~~~~~~~~~~~~~…

---

## [Memory consumption and number of threads](https://discuss.aerospike.com/t/memory-consumption-and-number-of-threads/7648)

<div class="topic-metadata">

**Author:** [@germannocr](https://discuss.aerospike.com/u/germannocr)\
**Replies:** 0\
**Last updated:** [July 17, 2020, 12:58pm UTC](https://discuss.aerospike.com/t/memory-consumption-and-number-of-threads/7648 "2020-07-17T12:58:54Z")

</div>

I am currently part of a team that develops a Python Rest API and uses Aerospike as a caching feature. However, its initialization has significantly increased the memory consumption and the number of threads, without any…

---

## [How to setup setup private IP using VPC peering for AWS Aerospike instance?](https://discuss.aerospike.com/t/how-to-setup-setup-private-ip-using-vpc-peering-for-aws-aerospike-instance/7530)

<div class="topic-metadata">

**Author:** [@Nitin\_Tiwari](https://discuss.aerospike.com/u/Nitin_Tiwari)\
**Replies:** 2\
**Last updated:** [June 14, 2020, 7:19am UTC](https://discuss.aerospike.com/t/how-to-setup-setup-private-ip-using-vpc-peering-for-aws-aerospike-instance/7530 "2020-06-14T07:19:52Z")

</div>

Code is deployed in AWS Lambda and it’s connecting to aerospike instance(t2 large) using public IP with python client but it is taking around 1.2012 seconds, sometimes more time to connect. Please suggest the steps to s…

---

## [How to get data about the namespace configurations using Python Client (example -Replication Factor)](https://discuss.aerospike.com/t/how-to-get-data-about-the-namespace-configurations-using-python-client-example-replication-factor/7504)

<div class="topic-metadata">

**Author:** [@ananya10588](https://discuss.aerospike.com/u/ananya10588)\
**Replies:** 3\
**Last updated:** [June 10, 2020, 5:58pm UTC](https://discuss.aerospike.com/t/how-to-get-data-about-the-namespace-configurations-using-python-client-example-replication-factor/7504 "2020-06-10T17:58:11Z")

</div>

Also, is there a way to get metrics like number of records for a particular namespace and set across the cluster using the Python Client (example - metrics provided by ‘info set’ )? Thanks for the help.

---

## [How to perfrom query on multiple secondary indexes using python client?](https://discuss.aerospike.com/t/how-to-perfrom-query-on-multiple-secondary-indexes-using-python-client/7475)

<div class="topic-metadata">

**Author:** [@Nitin\_Tiwari](https://discuss.aerospike.com/u/Nitin_Tiwari)\
**Replies:** 2\
**Last updated:** [May 28, 2020, 7:15pm UTC](https://discuss.aerospike.com/t/how-to-perfrom-query-on-multiple-secondary-indexes-using-python-client/7475 "2020-05-28T19:15:22Z")

</div>

name and geometry both are indexed { ‘name’: ‘nitin’, ’ geometry’: ‘{“type”: “Polygon”, “coordinates”: \[\[\[77.6367329816338, 12.9156783\], \[77.6358329816338, 12.9154783\], \[77.6340329816338, 12.9156783\], \[77.634032981633…

---

## [Python client - Nested map, map\_operation.get\_by\_key fails](https://discuss.aerospike.com/t/python-client-nested-map-map-operation-get-by-key-fails/7405)

<div class="topic-metadata">

**Author:** [@Pradeep\_Banavara](https://discuss.aerospike.com/u/Pradeep_Banavara)\
**Replies:** 1\
**Last updated:** [May 7, 2020, 6:54pm UTC](https://discuss.aerospike.com/t/python-client-nested-map-map-operation-get-by-key-fails/7405 "2020-05-07T18:54:20Z")

</div>

I am just trying out this CDT/Nested map operation in Python but not sure where I am going wrong. Using the latest docker image for Aerospike in default configuration. Any pointers will help. I get this error: (-2, ‘Fai…

---

## [Getting the following error while putting record in the aerospike database using python client](https://discuss.aerospike.com/t/getting-the-following-error-while-putting-record-in-the-aerospike-database-using-python-client/7339)

<div class="topic-metadata">

**Author:** [@Arpit\_Maiya](https://discuss.aerospike.com/u/Arpit_Maiya)\
**Replies:** 3\
**Last updated:** [April 22, 2020, 2:05am UTC](https://discuss.aerospike.com/t/getting-the-following-error-while-putting-record-in-the-aerospike-database-using-python-client/7339 "2020-04-22T02:05:18Z")

</div>

exception.ClientError: (-1, 'Unable to call dumps function', 'src/main/serializer.c', 364, False) Is this record size related issue ? Thanks in advance

---

## [Timeout options are not respected](https://discuss.aerospike.com/t/timeout-options-are-not-respected/7097)

<div class="topic-metadata">

**Author:** [@ricky.kwan.ix](https://discuss.aerospike.com/u/ricky.kwan.ix)\
**Replies:** 2\
**Last updated:** [January 31, 2020, 9:22pm UTC](https://discuss.aerospike.com/t/timeout-options-are-not-respected/7097 "2020-01-31T21:22:52Z")

</div>

Hi, We have clusters in different parts of the world. Among them, one is in Singapore (I’m in Canada). As such, when trying to connect with the client, it times out. Trying to increase the default timeout doesn’t seem t…

---

## [Error while installing python client for Aerospike](https://discuss.aerospike.com/t/error-while-installing-python-client-for-aerospike/1336)

<div class="topic-metadata">

**Author:** [@Amit](https://discuss.aerospike.com/u/Amit)\
**Replies:** 4\
**Last updated:** [December 11, 2019, 8:41am UTC](https://discuss.aerospike.com/t/error-while-installing-python-client-for-aerospike/1336 "2019-12-11T08:41:26Z")

</div>

I am trying to install aerospike python client on ubuntu 14.04 but getting this error while running “pip install aerospike” I have installed all the packages as mentioned on page along with python-dev package. Please as…

---

## [ETL pipeline with Airflow to load Oracle data to Aerospike on Prem, Aerospike in Cloud Containers and Google BigQuery table](https://discuss.aerospike.com/t/etl-pipeline-with-airflow-to-load-oracle-data-to-aerospike-on-prem-aerospike-in-cloud-containers-and-google-bigquery-table/6916)

<div class="topic-metadata">

**Author:** [@Mich\_Talebzadeh](https://discuss.aerospike.com/u/Mich_Talebzadeh)\
**Replies:** 0\
**Last updated:** [December 9, 2019, 4:38pm UTC](https://discuss.aerospike.com/t/etl-pipeline-with-airflow-to-load-oracle-data-to-aerospike-on-prem-aerospike-in-cloud-containers-and-google-bigquery-table/6916 "2019-12-09T16:38:29Z")

</div>

Hi, I wrote an article in LinkedIn to use Airflow for extracting Oracle data and loading it to Aerospike on Prem, Aerospike in containers in GCP plus BigQuery table You may find it useful Cheers, Mich

---

## [Syntax Error on Python Documentation](https://discuss.aerospike.com/t/syntax-error-on-python-documentation/6878)

<div class="topic-metadata">

**Author:** [@Benjamin\_Cabalona\_Jr](https://discuss.aerospike.com/u/Benjamin_Cabalona_Jr)\
**Replies:** 1\
**Last updated:** [December 6, 2019, 6:43pm UTC](https://discuss.aerospike.com/t/syntax-error-on-python-documentation/6878 "2019-12-06T18:43:23Z")

</div>

\# callback function will print the records as they are read def print\_result((key, metadata, record)): print(key, metadata, record) # Execute the scan and call print\_result for each result scan.foreach(print\_result)…

[Next page](https://discuss.aerospike.com/c/client-libraries/python-client/16.md?page=1)
