eastmoneypy是使用python来对东方财富进行操作的一个库。
目前在zvt中用于选股后自动添加到东财app,可参考该issue
实现功能:
- 管理组合
- 添加A股标的到组合
- 添加板块到组合
- 添加港股
- 添加美股
- 添加ETF
安装
pip3 install -U eastmoneypy
设置
打开网址并登录:http://quote.eastmoney.com/zixuan/
在用户目录里面,找到eastmoney-home/config.json,设置header和appkey
{
"header": "parse your total header here",
"appkey": "parse your appkey here"
}
使用
获取自选组合
In [1]: from eastmoneypy import *
In [2]: get_groups()
Out[2]:
[{'id': '130357503', 'name': '自选股', 'version': '322', 'source': 'web'},
{'id': '348275488', 'name': 'inging', 'version': '17', 'source': 'web'},
{'id': '215892391', 'name': '持仓', 'version': '118', 'source': 'mobile'},
{'id': '327237386', 'name': '港股', 'version': '6', 'source': 'mobile'},
{'id': '235046679', 'name': '刘世军', 'version': '10', 'source': 'mobile'},
{'id': '327744616', 'name': 'etf', 'version': '22', 'source': 'mobile'},
{'id': '350053618', 'name': 'tech', 'version': '0', 'source': 'web'},
{'id': '350485893', 'name': '你好', 'version': '0', 'source': 'web'},
{'id': '130357521', 'name': '持仓股', 'version': '1', 'source': 'mobile'}]
创建组合
In [3]: create_group('tmp')
Out[3]: (True, {'gid': '350518464', 'msg': '添加组合成功'})
添加股票到组合
>>> add_to_group('000999', group_name='tmp')
>>> add_to_group('BK1003', group_name='概念',entity_type='block')
>>> add_to_group('MSFT', group_name='tmp', entity_type='stockus')
>>> add_to_group('00700', group_name='tmp' entity_type='stockhk')
删除组合
In [5]: del_group('tmp')
联系方式
个人微信:foolcage 添加暗号:zvt
微信公众号:
Metadata
Release files for eastmoneypy 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| eastmoneypy-0.2.0.tar.gz | 9.1 kB | Without provenance | Details for eastmoneypy-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| eastmoneypy-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for eastmoneypy-0.2.0-py3-none-any.whl |
Total release size: 16.4 kB
Release files / eastmoneypy-0.2.0.tar.gz
| Download URL | eastmoneypy-0.2.0.tar.gz |
|---|---|
| Size | 9.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
136a0ffd9152ccd55ed88253f456b1d04e969184c0d54061c79273a4e2a0ea16
|
|
BLAKE2b-256 checksum How to use checksums |
6081bb4e7c0d130c668f0438149ea95c5f7fb1022e2e883e18fdc3c9c8cb5fda
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.23
|
Release files / eastmoneypy-0.2.0-py3-none-any.whl
| Download URL | eastmoneypy-0.2.0-py3-none-any.whl |
|---|---|
| Size | 7.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8a8232293a0f09dff41e1427501be9d6c07423668f217629bc424dd1acb615cb
|
|
BLAKE2b-256 checksum How to use checksums |
e4d667ade40310061f04e83169f22a9c1290a1ec43a7001ede78c016a3b0e9fb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.23
|
Security for eastmoneypy 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.