Name | lixinger JSON |
Version |
0.1.11
JSON |
| download |
home_page | |
Summary | Lixinger SDK for Python (Unofficial) |
upload_time | 2023-08-02 03:15:21 |
maintainer | |
docs_url | None |
author | |
requires_python | >=3.8 |
license | MIT |
keywords |
lixinger
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# lixinger
理杏仁 Python SDK (非官方).
包含以下功能:
- 自动将请求结果转换结果为 Dataframe.
- 根据官方文档中的返回结果定义, 验证请求结果, 对缺少的列进行补齐, 对列类型进行相应转换.
- 支持一次性获取时间范围大于 10 年的数据.
- 适当缓存请求结果, 减少请求 API 次数.
- 遇到网络错误时, 自动重试请求.
## 安装
```bash
pip install lixinger
```
## 用法
### 获取 Token
Token 获取地址为 [https://www.lixinger.com/open/api/token](https://www.lixinger.com/open/api/token).
### 调用 API
使用文档请参考 [理杏仁开放平台](https://www.lixinger.com/open/api/doc).
方法导入路径可以根据文档中的请求 URL 得出, 例如下面代码中对应的请求 URL 为 `/api/cn/company` 则把 `/` 换成 `.` 即可.
```python
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)
```
将会看到以下输出内容:
```bash
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]
```
Raw data
{
"_id": null,
"home_page": "",
"name": "lixinger",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "",
"keywords": "lixinger",
"author": "",
"author_email": "Chaoying <chaoying2022@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/b3/ed/0988ddda7b28bd72fc0c840f0533073b43faacb06de9f5915503d2e78c56/lixinger-0.1.11.tar.gz",
"platform": null,
"description": "# lixinger\n\n\u7406\u674f\u4ec1 Python SDK (\u975e\u5b98\u65b9).\n\n\u5305\u542b\u4ee5\u4e0b\u529f\u80fd:\n\n- \u81ea\u52a8\u5c06\u8bf7\u6c42\u7ed3\u679c\u8f6c\u6362\u7ed3\u679c\u4e3a Dataframe.\n- \u6839\u636e\u5b98\u65b9\u6587\u6863\u4e2d\u7684\u8fd4\u56de\u7ed3\u679c\u5b9a\u4e49, \u9a8c\u8bc1\u8bf7\u6c42\u7ed3\u679c, \u5bf9\u7f3a\u5c11\u7684\u5217\u8fdb\u884c\u8865\u9f50, \u5bf9\u5217\u7c7b\u578b\u8fdb\u884c\u76f8\u5e94\u8f6c\u6362.\n- \u652f\u6301\u4e00\u6b21\u6027\u83b7\u53d6\u65f6\u95f4\u8303\u56f4\u5927\u4e8e 10 \u5e74\u7684\u6570\u636e.\n- \u9002\u5f53\u7f13\u5b58\u8bf7\u6c42\u7ed3\u679c, \u51cf\u5c11\u8bf7\u6c42 API \u6b21\u6570.\n- \u9047\u5230\u7f51\u7edc\u9519\u8bef\u65f6, \u81ea\u52a8\u91cd\u8bd5\u8bf7\u6c42.\n\n## \u5b89\u88c5\n\n```bash\npip install lixinger\n```\n\n## \u7528\u6cd5\n\n### \u83b7\u53d6 Token\n\nToken \u83b7\u53d6\u5730\u5740\u4e3a [https://www.lixinger.com/open/api/token](https://www.lixinger.com/open/api/token).\n\n### \u8c03\u7528 API\n\n\u4f7f\u7528\u6587\u6863\u8bf7\u53c2\u8003 [\u7406\u674f\u4ec1\u5f00\u653e\u5e73\u53f0](https://www.lixinger.com/open/api/doc).\n\n\u65b9\u6cd5\u5bfc\u5165\u8def\u5f84\u53ef\u4ee5\u6839\u636e\u6587\u6863\u4e2d\u7684\u8bf7\u6c42 URL \u5f97\u51fa, \u4f8b\u5982\u4e0b\u9762\u4ee3\u7801\u4e2d\u5bf9\u5e94\u7684\u8bf7\u6c42 URL \u4e3a `/api/cn/company` \u5219\u628a `/` \u6362\u6210 `.` \u5373\u53ef.\n\n```python\nfrom lixinger.utils import set_token\nfrom lixinger.api.cn.company.base import get_company\n\n# \u8bbe\u7f6e Token\nset_token(\"your_token\")\n\n# \u83b7\u53d6\u80a1\u7968\u8be6\u7ec6\u4fe1\u606f\ncompany = get_company(stock_codes=[\"600519\"])\nprint(company)\n```\n\n\u5c06\u4f1a\u770b\u5230\u4ee5\u4e0b\u8f93\u51fa\u5185\u5bb9:\n\n```bash\n stock_code market ipo_date ... mutual_markets name fs_type\n0 600519 a 2001-08-26 16:00:00 ... ha \u8d35\u5dde\u8305\u53f0 non_financial\n\n[1 rows x 7 columns]\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Lixinger SDK for Python (Unofficial)",
"version": "0.1.11",
"project_urls": {
"Homepage": "https://github.com/Chaoyingz/lixinger",
"Repository": "https://github.com/Chaoyingz/lixinger"
},
"split_keywords": [
"lixinger"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "7447d3ac0db6d4eadaffa0c27044c586fe96a95ad05f326d4a21105375d53bf8",
"md5": "3d2056225250e0c358c2b142acb1bd4c",
"sha256": "da71abf751eac8ff32b23e072d7fa4b0eb94d04be3873597d790351eda53bba7"
},
"downloads": -1,
"filename": "lixinger-0.1.11-py3-none-any.whl",
"has_sig": false,
"md5_digest": "3d2056225250e0c358c2b142acb1bd4c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 21635,
"upload_time": "2023-08-02T03:15:20",
"upload_time_iso_8601": "2023-08-02T03:15:20.222790Z",
"url": "https://files.pythonhosted.org/packages/74/47/d3ac0db6d4eadaffa0c27044c586fe96a95ad05f326d4a21105375d53bf8/lixinger-0.1.11-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b3ed0988ddda7b28bd72fc0c840f0533073b43faacb06de9f5915503d2e78c56",
"md5": "d30ee1834b8bdcd8088f0d60a117f3fa",
"sha256": "7a1c5d6660763dd9d390e16d1d3fedff61555bb540e4cda1db039d32e459fcce"
},
"downloads": -1,
"filename": "lixinger-0.1.11.tar.gz",
"has_sig": false,
"md5_digest": "d30ee1834b8bdcd8088f0d60a117f3fa",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 11897,
"upload_time": "2023-08-02T03:15:21",
"upload_time_iso_8601": "2023-08-02T03:15:21.602032Z",
"url": "https://files.pythonhosted.org/packages/b3/ed/0988ddda7b28bd72fc0c840f0533073b43faacb06de9f5915503d2e78c56/lixinger-0.1.11.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-08-02 03:15:21",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Chaoyingz",
"github_project": "lixinger",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "lixinger"
}