Skip to main content

Zerone 私募股权数据 CLI 工具

Project description

Zerone CLI

Zerone 私募股权数据命令行工具,通过 API Key 直接查询 Zerone 数据平台。

安装

pip install zerone-cli

快速开始

1. 配置 API Key

zerone config set-api-key YOUR_API_KEY

如何获取 API Key?请访问 https://ai.zerone.com.cn 注册账号后申请。

2. 查看帮助

zerone --help

3. 开始查询

第一层:实体定位

# 实体模糊搜索
zerone entity-search "字节跳动"

第二层:业务专题

# 查询实体综合画像
zerone entity-profile "中国石油"

# 查询实体财务数据列表
zerone entity-financial-list "中国石油" --page 1 --page-size 50

# 查询融资概率预测
zerone model-financing-probability "字节跳动" --type COMPANY

# 查询机构匹配推荐
zerone model-company-match-gp "字节跳动" --page 1 --page-size 5

第三层:通用数据查询

# 查看有哪些表可以查
zerone get-available-tables

# 查看某张表的结构(字段名、类型、支持的操作符)
zerone get-table-schema company

# 单表查询(通过 JSON 文件传入参数)
zerone query --json-file query.json

# 聚合查询(通过 JSON 文件传入参数)
zerone aggregate --json-file aggregate.json

命令列表

命令 说明 层级
zerone config set-api-key 设置 API Key
zerone config set-server-url 设置服务器地址(可选)
zerone config show 查看当前配置
zerone entity-search 实体模糊搜索 第一层
zerone entity-profile 查询实体综合画像 第二层
zerone entity-financial-list 查询实体财务数据列表(分页) 第二层
zerone model-financing-probability 查询融资概率预测模型 第二层
zerone model-company-match-gp 为项目公司匹配潜在投资机构 第二层
zerone get-available-tables 获取可查询表列表 第三层
zerone get-table-schema 获取指定表结构 第三层
zerone query 单表查询(筛选/排序/分页) 第三层
zerone aggregate 聚合查询(GROUP BY + 聚合函数) 第三层

通用查询 JSON 参数示例

query.json(单表查询)

{
  "table": "company",
  "select_columns": ["company_name", "found_date", "vertical"],
  "filters": [
    {"field": "vertical", "type": "like", "value": "人工智能"},
    {"field": "found_date", "type": "range", "value": ["2020-01-01", "2024-12-31"]}
  ],
  "order_by": ["found_date DESC"],
  "limit": 50
}

aggregate.json(聚合查询)

{
  "table": "company",
  "group_by": ["reg_province"],
  "metrics": [
    {"field": "company_id", "func": "count", "alias": "company_count"}
  ],
  "filters": [
    {"field": "vertical", "type": "like", "value": "人工智能"}
  ],
  "order_by": ["company_count DESC"],
  "limit": 50
}

使用方式

# 从文件读取参数
zerone query --json-file query.json
zerone aggregate --json-file aggregate.json

# 直接传入 JSON 字符串
zerone query --json '{"table":"company","select_columns":["company_name"],"limit":10}'
zerone aggregate --json '{"table":"company","group_by":["reg_province"],"metrics":[{"field":"company_id","func":"count","alias":"cnt"}]}'

常用参数说明

分页参数

  • --page: 页码,从1开始,默认1
  • --page-size: 每页条数,默认50,上限50

输出格式

  • --output: 输出格式,可选 table/json/csv,默认 table

查询参数

  • --json-file: JSON 参数文件路径(query/aggregate 专用)
  • --json: JSON 参数字符串(query/aggregate 专用)

配置说明

配置文件保存在 ~/.zerone/config.yaml,支持以下环境变量覆盖:

环境变量 说明
ZERONE_API_KEY API Key
ZERONE_SERVER_URL 服务器地址

系统要求

  • Python 3.9+
  • 有效的 Zerone API Key

许可证

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zerone_cli-0.3.1.tar.gz (12.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zerone_cli-0.3.1-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

Details for the file zerone_cli-0.3.1.tar.gz.

File metadata

  • Download URL: zerone_cli-0.3.1.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for zerone_cli-0.3.1.tar.gz
Algorithm Hash digest
SHA256 7690657bfe776bd52455825dfdc8aa2ac8c83909d3459ef8719fb6aa2281a79a
MD5 5246e51f766a0bfdc8d878e65f0e9922
BLAKE2b-256 592fc7da901801617844330c1388c8d086e326140eb3f3cc3dee0d20a695e465

See more details on using hashes here.

File details

Details for the file zerone_cli-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: zerone_cli-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 17.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for zerone_cli-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 158ba38b553c712389225afe5019008e21ae3c61843ddf975149cc2cf3e7e0e5
MD5 1bac54dfab506d1ebe66caa4304f4267
BLAKE2b-256 f5437f4746e1e6b9f0197f5b7dff180ea29752469146dc55e64845612f6afc90

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page