Skip to main content

Lixinger SDK for Python (Unofficial)

Project description

lixinger

理杏仁 Python SDK (非官方).

包含以下功能:

  • 自动将请求结果转换结果为 Dataframe.
  • 根据官方文档中的返回结果定义, 验证请求结果, 对缺少的列进行补齐, 对列类型进行转换.
  • 支持一次获取时间范围大于10年的数据.

安装

pip install lixinger

用法

设置 Token

Token 获取地址为 https://www.lixinger.com/open/api/token

方式1:通过环境变量来设置 Token

export LIXINGER_TOKEN="你的 token"

方式2:通过配置文件来设置 Token

打开配置文件(路径为 ~/.config/lixinger/settings.toml),并添加以下内容设置自己的 Token.

[default]
token = "你的 token"

调用 API

使用文档请参考 理杏仁开放平台

from lixinger.api.cn.company.base import get_company

# 获取股票详细信息
company = get_company(stock_codes=["600519"])
print(company)

将会看到以下输出内容:

  stock_code market            ipo_date  ... mutual_markets  name        fs_type
0     600519      a 2001-08-26 16:00:00  ...             ha  贵州茅台  non_financial

[1 rows x 7 columns]

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

lixinger-0.1.6.tar.gz (9.4 kB view hashes)

Uploaded Source

Built Distribution

lixinger-0.1.6-py3-none-any.whl (17.1 kB view hashes)

Uploaded Python 3

Supported by

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