Skip to main content

python lib for operating eastmoney

Project description

image image image build package

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
Wechat


微信公众号:
Wechat

知乎专栏:
https://zhuanlan.zhihu.com/automoney

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

eastmoneypy-0.1.7.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

eastmoneypy-0.1.7-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file eastmoneypy-0.1.7.tar.gz.

File metadata

  • Download URL: eastmoneypy-0.1.7.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.19

File hashes

Hashes for eastmoneypy-0.1.7.tar.gz
Algorithm Hash digest
SHA256 ff2595231ac8a2064a804f550623fbd16a542830821d5aae4d0c88b4095669f2
MD5 cc603c50d4700346b7a4936257d715d8
BLAKE2b-256 6103a0d7ca566ba7bd927ed9855fa7bd3a9f9d5c9486c6aeee786e694cf97d74

See more details on using hashes here.

File details

Details for the file eastmoneypy-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: eastmoneypy-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.19

File hashes

Hashes for eastmoneypy-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 42ebb88ab51221b412398c29b7260171cbdd9b4636477f9e0543a5a960d14350
MD5 64eff2a7301e3bb80cc28906bf031961
BLAKE2b-256 54d7841f4ec3ae637f00cdbb2e4bfaace5234573bb8d650905831ee15cb6bcde

See more details on using hashes here.

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