[![image](https://img.shields.io/pypi/v/eastmoneypy.svg)](https://pypi.org/project/eastmoneypy/)
[![image](https://img.shields.io/pypi/l/eastmoneypy.svg)](https://pypi.org/project/eastmoneypy/)
[![image](https://img.shields.io/pypi/pyversions/eastmoneypy.svg)](https://pypi.org/project/eastmoneypy/)
[![build](https://github.com/zvtvz/eastmoneypy/actions/workflows/build.yaml/badge.svg)](https://github.com/zvtvz/eastmoneypy/actions/workflows/build.yml)
[![package](https://github.com/zvtvz/eastmoneypy/actions/workflows/package.yaml/badge.svg)](https://github.com/zvtvz/eastmoneypy/actions/workflows/package.yaml)
eastmoneypy是使用python来对[东方财富](http://www.eastmoney.com/)进行操作的一个库。
目前在[zvt](https://github.com/zvtvz/zvt)中用于选股后自动添加到东财app,可参考该[issue](https://github.com/zvtvz/zvt/issues/48)
## 实现功能:
- [x] 管理组合
- [x] 添加A股标的到组合
- [x] 添加板块到组合
- [x] 添加港股
- [x] 添加美股
- [ ] 添加ETF
## 安装
```
pip3 install -U eastmoneypy
```
## 设置
打开网址并登录:http://quote.eastmoney.com/zixuan/
<p align="center"><img src='./key.png'/></p>
在用户目录里面,找到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
<img src="https://raw.githubusercontent.com/zvtvz/zvt/master/docs/imgs/wechat.jpeg" width="25%" alt="Wechat">
------
微信公众号:
<img src="https://raw.githubusercontent.com/zvtvz/zvt/master/docs/imgs/gongzhonghao.jpg" width="25%" alt="Wechat">
知乎专栏:
https://zhuanlan.zhihu.com/automoney
Raw data
{
"_id": null,
"home_page": "https://github.com/zvtvz/eastmoneypy",
"name": "eastmoneypy",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "eastmoney python",
"author": "foolcage",
"author_email": "5533061@qq.com",
"download_url": "https://files.pythonhosted.org/packages/80/e9/70524e6bf75b02904588a6953864a23e487e56c9dc4b7b9763743a8da64b/eastmoneypy-0.1.9.tar.gz",
"platform": null,
"description": "[![image](https://img.shields.io/pypi/v/eastmoneypy.svg)](https://pypi.org/project/eastmoneypy/)\n[![image](https://img.shields.io/pypi/l/eastmoneypy.svg)](https://pypi.org/project/eastmoneypy/)\n[![image](https://img.shields.io/pypi/pyversions/eastmoneypy.svg)](https://pypi.org/project/eastmoneypy/)\n[![build](https://github.com/zvtvz/eastmoneypy/actions/workflows/build.yaml/badge.svg)](https://github.com/zvtvz/eastmoneypy/actions/workflows/build.yml)\n[![package](https://github.com/zvtvz/eastmoneypy/actions/workflows/package.yaml/badge.svg)](https://github.com/zvtvz/eastmoneypy/actions/workflows/package.yaml)\n\neastmoneypy\u662f\u4f7f\u7528python\u6765\u5bf9[\u4e1c\u65b9\u8d22\u5bcc](http://www.eastmoney.com/)\u8fdb\u884c\u64cd\u4f5c\u7684\u4e00\u4e2a\u5e93\u3002 \n\u76ee\u524d\u5728[zvt](https://github.com/zvtvz/zvt)\u4e2d\u7528\u4e8e\u9009\u80a1\u540e\u81ea\u52a8\u6dfb\u52a0\u5230\u4e1c\u8d22app\uff0c\u53ef\u53c2\u8003\u8be5[issue](https://github.com/zvtvz/zvt/issues/48)\n## \u5b9e\u73b0\u529f\u80fd\uff1a\n- [x] \u7ba1\u7406\u7ec4\u5408\n- [x] \u6dfb\u52a0A\u80a1\u6807\u7684\u5230\u7ec4\u5408\n- [x] \u6dfb\u52a0\u677f\u5757\u5230\u7ec4\u5408\n- [x] \u6dfb\u52a0\u6e2f\u80a1\n- [x] \u6dfb\u52a0\u7f8e\u80a1\n- [ ] \u6dfb\u52a0ETF\n\n\n## \u5b89\u88c5\n```\npip3 install -U eastmoneypy\n```\n\n## \u8bbe\u7f6e\n\n\u6253\u5f00\u7f51\u5740\u5e76\u767b\u5f55:http://quote.eastmoney.com/zixuan/\n\n<p align=\"center\"><img src='./key.png'/></p>\n\n\u5728\u7528\u6237\u76ee\u5f55\u91cc\u9762\uff0c\u627e\u5230eastmoney-home/config.json\uff0c\u8bbe\u7f6eheader\u548cappkey\n```\n{\n \"header\": \"parse your total header here\",\n \"appkey\": \"parse your appkey here\"\n}\n```\n\n## \u4f7f\u7528\n\n### \u83b7\u53d6\u81ea\u9009\u7ec4\u5408\n```\nIn [1]: from eastmoneypy import *\nIn [2]: get_groups()\nOut[2]:\n[{'id': '130357503', 'name': '\u81ea\u9009\u80a1', 'version': '322', 'source': 'web'},\n {'id': '348275488', 'name': 'inging', 'version': '17', 'source': 'web'},\n {'id': '215892391', 'name': '\u6301\u4ed3', 'version': '118', 'source': 'mobile'},\n {'id': '327237386', 'name': '\u6e2f\u80a1', 'version': '6', 'source': 'mobile'},\n {'id': '235046679', 'name': '\u5218\u4e16\u519b', 'version': '10', 'source': 'mobile'},\n {'id': '327744616', 'name': 'etf', 'version': '22', 'source': 'mobile'},\n {'id': '350053618', 'name': 'tech', 'version': '0', 'source': 'web'},\n {'id': '350485893', 'name': '\u4f60\u597d', 'version': '0', 'source': 'web'},\n {'id': '130357521', 'name': '\u6301\u4ed3\u80a1', 'version': '1', 'source': 'mobile'}]\n```\n\n### \u521b\u5efa\u7ec4\u5408\n```\nIn [3]: create_group('tmp')\nOut[3]: (True, {'gid': '350518464', 'msg': '\u6dfb\u52a0\u7ec4\u5408\u6210\u529f'})\n```\n\n### \u6dfb\u52a0\u80a1\u7968\u5230\u7ec4\u5408\n```\n>>> add_to_group('000999', group_name='tmp')\n>>> add_to_group('BK1003', group_name='\u6982\u5ff5',entity_type='block')\n>>> add_to_group('MSFT', group_name='tmp', entity_type='stockus')\n>>> add_to_group('00700', group_name='tmp' entity_type='stockhk')\n```\n\n### \u5220\u9664\u7ec4\u5408\n```\nIn [5]: del_group('tmp')\n```\n\n## \u8054\u7cfb\u65b9\u5f0f\n\n\u4e2a\u4eba\u5fae\u4fe1:foolcage \u6dfb\u52a0\u6697\u53f7:zvt \n<img src=\"https://raw.githubusercontent.com/zvtvz/zvt/master/docs/imgs/wechat.jpeg\" width=\"25%\" alt=\"Wechat\">\n\n------\n\u5fae\u4fe1\u516c\u4f17\u53f7: \n<img src=\"https://raw.githubusercontent.com/zvtvz/zvt/master/docs/imgs/gongzhonghao.jpg\" width=\"25%\" alt=\"Wechat\">\n\n\u77e5\u4e4e\u4e13\u680f: \nhttps://zhuanlan.zhihu.com/automoney\n",
"bugtrack_url": null,
"license": null,
"summary": "python lib for operating eastmoney",
"version": "0.1.9",
"project_urls": {
"Bug Reports": "https://github.com/zvtvz/eastmoneypy/issues",
"Funding": "https://www.foolcage.com",
"Homepage": "https://github.com/zvtvz/eastmoneypy",
"Say Thanks!": "https://saythanks.io/to/foolcage",
"Source": "https://github.com/zvtvz/eastmoneypy"
},
"split_keywords": [
"eastmoney",
"python"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "8040c8a6bb332fdfa79da2b4cfde2c405b1f7e3a65a953abc0ed08e8d0d633dd",
"md5": "869b09fb8ccbb6998020fc2e9faa3d3b",
"sha256": "d74146be04b32420030f853ba63a9c80f0c35570ebe71d2b418bdd2a10ad412f"
},
"downloads": -1,
"filename": "eastmoneypy-0.1.9-py3-none-any.whl",
"has_sig": false,
"md5_digest": "869b09fb8ccbb6998020fc2e9faa3d3b",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 6510,
"upload_time": "2024-11-27T10:39:04",
"upload_time_iso_8601": "2024-11-27T10:39:04.205406Z",
"url": "https://files.pythonhosted.org/packages/80/40/c8a6bb332fdfa79da2b4cfde2c405b1f7e3a65a953abc0ed08e8d0d633dd/eastmoneypy-0.1.9-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "80e970524e6bf75b02904588a6953864a23e487e56c9dc4b7b9763743a8da64b",
"md5": "f29b984f98f52d09696ff962adf4b591",
"sha256": "742a906a3fecccbc5c8d1782bcd792371676e653ea51036c2cc6d8cdb9814185"
},
"downloads": -1,
"filename": "eastmoneypy-0.1.9.tar.gz",
"has_sig": false,
"md5_digest": "f29b984f98f52d09696ff962adf4b591",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 8500,
"upload_time": "2024-11-27T10:39:05",
"upload_time_iso_8601": "2024-11-27T10:39:05.812800Z",
"url": "https://files.pythonhosted.org/packages/80/e9/70524e6bf75b02904588a6953864a23e487e56c9dc4b7b9763743a8da64b/eastmoneypy-0.1.9.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-27 10:39:05",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "zvtvz",
"github_project": "eastmoneypy",
"travis_ci": true,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "requests",
"specs": [
[
"==",
"2.20.1"
]
]
},
{
"name": "demjson3",
"specs": [
[
"==",
"3.0.5"
]
]
}
],
"lcname": "eastmoneypy"
}