跳转到主要内容

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 查看哈希)

上传时间: Python 2 Python 3

由以下机构支持

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误记录 StatusPage StatusPage 状态页面