Git Product home page Git Product logo

eastmoneypy's Introduction

image image image Build Status codecov.io HitCount

eastmoneypy是使用python来对东方财富进行操作的一个库。
目前在zvt中用于选股后自动添加到东财app,可参考该issue

实现功能:

  • 管理组合
  • 添加A股标的到组合
  • 添加ETF
  • 添加港股

安装

pip3 install eastmoneypy -i http://pypi.douban.com/simple --trusted-host pypi.douban.com

设置

打开网址并登录:http://quote.eastmoney.com/zixuan/

在用户目录里面,找到eastmoney-home/config.json,把copy的header设置到里面

{
  "header": "parse your total header 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': '添加组合成功'})

添加股票到组合

In [4]: add_to_group('000999',group_name='tmp')
2020-02-14 23:34:55,287  INFO  MainThread  ret:{'re': True, 'message': '', 'result': {'ver': '1', 'msg': '添加股票成功'}}
Out[4]: True

删除组合

In [5]: del_group('tmp')

联系方式

QQ群:300911873

个人微信:foolcage 添加暗号:zvt
Wechat


微信公众号:
Wechat

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

eastmoneypy's People

Contributors

foolcage avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.