Python client library for Pilosa
Project description
Python Client for Pilosa
Python client for Pilosa high performance distributed row index.
What's New?
See: CHANGELOG
Requirements
- Python 2.7 and higher or Python 3.4 and higher.
Install
Pilosa client is on PyPI. You can install the library using pip
:
pip install pilosa
Usage
Quick overview
Assuming Pilosa server is running at localhost:10101
(the default):
import pilosa
# Create the default client
client = pilosa.Client()
# Retrieve the schema
schema = client.schema()
# Create an Index object
myindex = schema.index("myindex")
# Create a Field object
myfield = myindex.field("myfield")
# make sure the index and field exists on the server
client.sync_schema(schema)
# Send a Set query. PilosaError is thrown if execution of the query fails.
client.query(myfield.set(5, 42))
# Send a Row query. PilosaError is thrown if execution of the query fails.
response = client.query(myfield.row(5))
# Get the result
result = response.result
# Act on the result
if result:
columns = result.row.columns
print("Got columns: ", columns)
# You can batch queries to improve throughput
response = client.query(
myindex.batch_query(
myfield.row(5),
myfield.row(10),
)
)
for result in response.results:
# Act on the result
print(result.row.columns)
Documentation
Data Model and Queries
Executing Queries
See: Server Interaction
Importing and Exporting Data
See: Importing and Exporting Data
Contributing
See: CONTRIBUTING
License
See: LICENSE
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pilosa-1.0.2.tar.gz
(19.9 kB
view hashes)
Built Distribution
pilosa-1.0.2-py2.py3-none-any.whl
(26.4 kB
view hashes)
Close
Hashes for pilosa-1.0.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13e520856e2f359a7423421c237fbcfc5bd110a7258679be8a0951e8fc883dce |
|
MD5 | e600e72f10d97ef282127ac1904aca5f |
|
BLAKE2b-256 | 46b76e3b77e44b0bd7f4076916505fc01f02743324238def43b6aa84b3c31ceb |