Python客户端库用于Pilosa
项目描述
Python客户端库用于Pilosa
Python客户端库,用于Pilosa高性能分布式行索引。
有什么新功能?
见: 变更日志
要求
- 与Pilosa 1.2和Pilosa 1.3兼容
- 需要Python 2.7或更高版本,或Python 3.4或更高版本。
安装
Pilosa客户端在 PyPI 上。您可以使用 pip
安装库。
pip install pilosa
用法
快速概述
假设 Pilosa 服务器运行在 localhost:10101
(默认)
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)
文档
数据模型和查询
见: 数据模型和查询
执行查询
见: 服务器交互
导入和导出数据
参见:导入和导出数据
其他文档
贡献
参见:CONTRIBUTING
许可证
参见:LICENSE
项目详情
下载文件
下载适合您平台的文件。如果您不确定选择哪个,请了解有关安装包的更多信息。
源代码发行版
pilosa-1.3.1.tar.gz (28.6 kB 查看哈希)
构建发行版
pilosa-1.3.1-py2.py3-none-any.whl (33.8 kB 查看哈希)
关闭
pilosa-1.3.1.tar.gz 的哈希
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 670f57b9163387a5f106f174c0d5a99d5d4a36d132b147747db16272793625cf |
|
MD5 | ef7ed2edaefc547be304550f1c9ecd91 |
|
BLAKE2b-256 | 386f4bc55896de925600be4a1368d284a1e5b69c0e6b88843c009ac4e5331154 |
关闭
pilosa-1.3.1-py2.py3-none-any.whl 的哈希
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 734a820298b837f27f936144518186ebeef12e2fc68136f61c63689581dc3bc1 |
|
MD5 | b48e91eabc4b5dcd75894c01f5e0c227 |
|
BLAKE2b-256 | 37311b16506679f4d6cae95d82c94cfb1f52928d72168c2cdcd70a8caa5f9607 |