Welcome to Python Client for Pilosa’s documentation!

Python client for Pilosa high performance distributed bitmap index.


  • Python 2.6 and higher or Python 3.3 and higher


Pilosa client is on PyPI. You can install the library using pip:

pip install pilosa

Quick overview

Assuming Pilosa server is running at localhost:10101 (the default):

import pilosa

# Create the default client
client = pilosa.Client()

# Create an Index object
myindex = pilosa.Index("myindex")

# Make sure the index exists on the server

# Create a Frame object
myframe = myindex.frame("myframe")

# Make sure the frame exists on the server

# Send a SetBit query. PilosaError is thrown if execution of the query fails.
client.query(myframe.setbit(5, 42))

# Send a Bitmap query. PilosaError is thrown if execution of the query fails.
response = client.query(myframe.bitmap(5))

# Get the result
result = response.result

# Act on the result
if result:
    bits = result.bitmap.bits
    print("Got bits: ", bits)

# You can batch queries to improve throughput
response = client.query(
for result in response.results:
    # Act on the result

Indices and tables