Skip to main content

lixinger

理杏仁 Python SDK (非官方).

包含以下功能:

  • 自动将请求结果转换结果为 Dataframe.
  • 根据官方文档中的返回结果定义, 验证请求结果, 对缺少的列进行补齐, 对列类型进行相应转换.
  • 支持一次性获取时间范围大于 10 年的数据.
  • 适当缓存请求结果, 减少请求 API 次数.
  • 遇到网络错误时, 自动重试请求.

安装

pip install lixinger

用法

获取 Token

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

调用 API

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

方法导入路径可以根据文档中的请求 URL 得出, 例如下面代码中对应的请求 URL 为 /api/cn/company 则把 / 换成 . 即可.

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

# 设置 Token
set_token("your_token")

# 获取股票详细信息
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]

Release files for lixinger 0.1.11

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lixinger 0.1.11
File Size Uploaded
lixinger-0.1.11.tar.gz 11.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lixinger 0.1.11
File Interpreter ABI Platform
lixinger-0.1.11-py3-none-any.whl Python 3 none any Details

Total release size:33.5 kB

Release files / lixinger-0.1.11.tar.gz

Download URL lixinger-0.1.11.tar.gz
Size 11.9 kB
Tags Source
SHA-256 checksum
How to use checksums
7a1c5d6660763dd9d390e16d1d3fedff61555bb540e4cda1db039d32e459fcce
BLAKE2b-256 checksum
How to use checksums
b3ed0988ddda7b28bd72fc0c840f0533073b43faacb06de9f5915503d2e78c56
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via pdm/2.6.1 CPython/3.9.13

Release files / lixinger-0.1.11-py3-none-any.whl

Download URL lixinger-0.1.11-py3-none-any.whl
Size 21.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
da71abf751eac8ff32b23e072d7fa4b0eb94d04be3873597d790351eda53bba7
BLAKE2b-256 checksum
How to use checksums
7447d3ac0db6d4eadaffa0c27044c586fe96a95ad05f326d4a21105375d53bf8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via pdm/2.6.1 CPython/3.9.13

Release history Release notifications | RSS feed

This release

0.1.11 This release

2 release files

0.1.10

1 release file

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page