# easyquotation
[![Package](https://img.shields.io/pypi/v/snowland-easyquotation.svg)](https://pypi.python.org/pypi/snowland-easyquotation)
快速获取新浪/腾讯的全市场行情, 网络正常的情况下只需要 `200+ms`
### 前言
* 获取新浪的免费实时行情
* 获取腾讯财经的免费实时行情
* 获取集思路的分级基金数据
### requirements
> Python 3.6+
> pip install -r requirements.txt
### 安装
```commandline
pip install easyquotation
```
也可以下载源码,然后安装
```commandline
python setup.py install
```
#### 升级
```commandline
pip install easyquotation --upgrade
```
### 用法
#### 引入:
```python
import easyquotation
```
#### 选择行情
```python
quotation = easyquotation.use('sina') # 新浪 ['sina'] 腾讯 ['tencent', 'qq']
```
#### 获取所有股票行情
```python
quotation.market_snapshot(prefix=True) # prefix 参数指定返回的行情字典中的股票代码 key 是否带 sz/sh 前缀
```
**return**
```json
{'sh000159': {'name': '国际实业', # 股票名
'buy': 8.87, # 竞买价
'sell': 8.88, # 竞卖价
'now': 8.88, # 现价
'open': 8.99, # 开盘价
'close': 8.96, # 昨日收盘价
'high': 9.15, # 今日最高价
'low': 8.83, # 今日最低价
'turnover': 22545048, # 交易股数
'volume': 202704887.74, # 交易金额
'ask1': 8.88, # 卖一价
'ask1_volume': 111900, # 卖一量
'ask2': 8.89,
'ask2_volume': 54700,
'bid1': 8.87, # 买一价
'bid1_volume': 21800, # 买一量
...
'bid2': 8.86,
'bid2_volume': 78400,
'date': '2016-02-19',
'time': '14:30:00',
...},
......
}
```
##### 单只股票
```
quotation.real('162411') # 支持直接指定前缀,如 'sh000001'
```
##### 多只股票
```
quotation.stocks(['000001', '162411'])
```
##### 同时获取指数和行情
```
quotation.stocks(['sh000001', 'sz000001'], prefix=True)
```
#### 更新股票代码
```
easyquotation.update_stock_codes()
```
#### 选择 [jsl](https://www.jisilu.cn)(集思路) 行情
```
quotation = easyquotation.use('jsl') # ['jsl']
```
##### 设置 cookie (可选)
不设置的话获取相关数据有限制
```
quotation.set_cookie('从浏览器获取的集思录 Cookie')
```
##### 获取分级基金信息
```
quotation.funda() # 参数可选择利率、折价率、交易量、有无下折、是否永续来过滤
quotation.fundb() # 参数如上
```
对应的分级 A 数据
**return**
```
{ 150020:
{'abrate': '5:5',
'calc_info': None,
'coupon_descr': '+3.0%',
'coupon_descr_s': '+3.0%',
'fund_descr': '每年第一个工作日定折,无下折,A不参与上折,净值<1元无定折',
'funda_amount': 178823,
'funda_amount_increase': '0',
'funda_amount_increase_rt': '0.00%',
'funda_base_est_dis_rt': '2.27%',
'funda_base_est_dis_rt_t1': '2.27%',
'funda_base_est_dis_rt_t2': '-0.34%',
'funda_base_est_dis_rt_tip': '',
'funda_base_fund_id': '163109',
'funda_coupon': '5.75',
'funda_coupon_next': '4.75',
'funda_current_price': '0.783',
'funda_discount_rt': '24.75%',
'funda_id': '150022',
'funda_increase_rt': '0.00%',
'funda_index_id': '399001',
'funda_index_increase_rt': '0.00%',
'funda_index_name': '深证成指',
'funda_left_year': '永续',
'funda_lower_recalc_rt': '1.82%',
'funda_name': '深成指A',
'funda_nav_dt': '2015-09-14',
'funda_profit_rt': '7.74%',
'funda_profit_rt_next': '6.424%',
'funda_value': '1.0405',
'funda_volume': '0.00',
'fundb_upper_recalc_rt': '244.35%',
'fundb_upper_recalc_rt_info': '深成指A不参与上折',
'last_time': '09:18:22',
'left_recalc_year': '0.30411',
'lower_recalc_profit_rt': '-',
'next_recalc_dt': '<span style="font-style:italic">2016-01-04</span>',
'owned': 0,
'status_cd': 'N'}>'}}
```
##### 分级基金套利接口
```
quotation.fundarb(jsl_username, jsl_password, avolume=100, bvolume=100, ptype='price')
```
```
jsl_username: 集思录用户名
jsl_password: 集思路登录密码
avolume: A成交额,单位百万
bvolume: B成交额,单位百万
ptype: 溢价计算方式,price=现价,buy=买一,sell=卖一
```
**return**
```
{
"165511":{
'base_fund_id': '165511', # 母基金代码
'AB_price': '现价A/B : 1.008/1.329',
'a_profit_rt_next': '4.705',
'a_ratio': 4,
'abrate': '4:6',
'apply_fee': '0',
'apply_fee_tip': '0',
'apply_sell': '-0.59',
'asset_ratio': '95%',
'asset_ratio_last': '99%',
'asset_ratio_num': '95.00',
'b_est_val': '1.340',
'b_gangan': '1.502',
'b_ratio': 6,
'base_est_dis_rt': '-0.56%',
'base_est_val': '1.2073',
'base_fund_nm': '信诚500',
'base_lower_recalc_rt': '54.15%',
'base_nav': '1.1970',
'base_nav_dt': '2016-04-13',
'buy1A': '1.007',
'buy1B': '1.329',
'buy1_amountA': '0.201',
'buy1_amountB': '7.123',
'buy_redeem': '-0.51',
'calc_info': None,
'coupon': '0.00%',
'coupon_next': '4.700',
'est_dis_rt': '-0.55%',
'est_time': '2016-04-14 15:10:05',
'fundA_amount': '6667',
'fundA_amount_increase': '-51',
'fundA_amount_increase_rt': '-0.76%',
'fundA_amount_tip': '2016-04-14 A类总份额6667.000万份,份额增长-0.76%',
'fundA_id': '150028',
'fundA_last_dt': '2016-04-14',
'fundA_last_time': '14:57:02',
'fundA_nav': '1.0090',
'fundA_nav_dt': '2016-04-13',
'fundA_nm': '中证500A',
'fundA_stock_volume': '28.2446',
'fundA_stock_volume_tip': 'A类总份额6667.000万份, 成交28万份',
'fundA_turnover_rt': '0.42%',
'fundA_volume': '28.46',
'fundB_amount': 10000.5,
'fundB_amount_increase': '-76',
'fundB_amount_tip': '2016-04-14 B类总份额10000万份,份额增长-0.76%',
'fundB_id': '150029',
'fundB_last_dt': '2016-04-14',
'fundB_last_time': '15:00:27',
'fundB_nav': '1.3220',
'fundB_nav_dt': '2016-04-13',
'fundB_nm': '中证500B',
'fundB_stock_volume': '255.5280',
'fundB_stock_volume_tip': 'B类总份额10000万份, 成交256万份',
'fundB_turnover_rt': '2.56%',
'fundB_volume': '337.24',
'fund_company_nm': '信诚基金',
'funda_name_tip': '下期利率:4.70,修正收益率:4.71%',
'idx_incr_rt': '0.91%',
'increase_rtA': '-0.10%',
'increase_rtB': '1.06%',
'index_id': '399905',
'index_nm': '中证 500',
'is_est_val': 1,
'is_last_nav': 1,
'lower_recalc_rt': '54.15',
'maturity_dt': '-',
'merge_price': '1.2006',
'min_apply_amount': None,
'notes': 'http://www.xcfunds.com/funds_2012/165511/fundinfor.shtml\r\n',
'ownedA': 0,
'ownedM': 1,
'priceA': '1.008',
'priceB': '1.329',
'real_idx_increase_rt': '0.91',
'recalc_to': None,
'redeem_fee': '0.5%',
'redeem_fee_tip': '0.5%',
'sell1A': '1.008',
'sell1B': '1.330',
'sell1_amountA': '7.132',
'sell1_amountB': '16.820',
'status_cd': 'N'
}
}
```
##### 指数ETF查询接口
**TIP :** 尚未包含黄金ETF和货币ETF
*[集思录ETF源网页](https://www.jisilu.cn/data/etf/#tlink_2)*
```
quotation.etfindex(index_id="", min_volume=0, max_discount=None, min_discount=None)
```
**return**
```
{
"510050": {
"fund_id": "510050", # 代码
"fund_nm": "50ETF", # 名称
"price": "2.066", # 现价
"increase_rt": "0.34%", # 涨幅
"volume": "71290.96", # 成交额(万元)
"index_nm": "上证50", # 指数
"pe": "9.038", # 指数PE
"pb": "1.151", # 指数PB
"index_increase_rt": "0.45%", # 指数涨幅
"estimate_value": "2.0733", # 估值
"fund_nav": "2.0730", # 净值
"nav_dt": "2016-03-11", # 净值日期
"discount_rt": "-0.34%", # 溢价率
"creation_unit": "90", # 最小申赎单位(万份)
"amount": "1315800", # 份额
"unit_total": "271.84", # 规模(亿元)
"index_id": "000016", # 指数代码
"last_time": "15:00:00", # 价格最后时间(未确定)
"last_est_time": "23:50:02", # 估值最后时间(未确定)
}
}
```
##### 分数图
*[腾讯分时图地址](http://data.gtimg.cn/flashdata/hushen/minute/sz000001.js)*
```python
quotation = easyquotation.use("timekline")
data = quotation.real(['603828'], prefix=True)
```
**return**
```
{
'sh603828': {
'date': '170721', #日期
'time_data': {
'201707210930': ['0930', '19.42', '61'], # [时间, 当前价, 上一分钟到这一分钟之间的成交数量]
'201707210931': ['0931', '19.42','122'],
'201707210932': ['0932', '19.43', '123'],
'201707210933': ['0933', '19.48', '125'],
'201707210934': ['0934', '19.49', '133'],
'201707210935': ['0935', '19.48', '161'],
...
}
}
```
##### 港股日k线图
*[腾讯日k线图](http://web.ifzq.gtimg.cn/appstock/app/hkfqkline/get?_var=kline_dayqfq¶m=hk00700,day,,,350,qfq&r=0.7773272375526847)*
```python
import easyquotation
quotation = easyquotation.use("daykline")
data = quotation.real(['00001','00700'])
print(data)
```
*return*
```
{
'00001': [
['2017-10-09', '352.00', '349.00', '353.00', '348.60', '13455864.00'], # [日期, 今开, 今收, 最高, 最低, 成交量 ]
['2017-10-10', '350.80', '351.20', '352.60', '349.80', '10088970.00'],
]
'00700':[
]
}
}
```
##### 腾讯港股时时行情
*[腾讯控股时时行情](http://sqt.gtimg.cn/utf8/q=r_hk00700)*
```python
import easyquotation
quotation = easyquotation.use("hkquote")
data = quotation.real(['00001','00700'])
print(data)
```
```
{
'00001':
{
'stock_code': '00001', # 股票代码
'lotSize': '"100', # 每手数量
'name': '长和', # 股票名称
'price': '97.20', # 股票当前价格
'lastPrice': '97.75', # 股票昨天收盘价格
'openPrice': '97.75', # 股票今天开盘价格
'amount': '1641463.0', # 股票成交量
'time': '2017/11/29 15:38:58', # 当前时间
'high': '98.05', # 当天最高价格
'low': '97.15' # 当天最低价格
},
'00700':
{
'stock_code': '00700',
'lotSize': '"100',
'name': '腾讯控股',
'price': '413.20',
'lastPrice': '419.20',
'openPrice': '422.20',
'amount': '21351010.0',
'time': '2017/11/29 15:39:01',
'high': '422.80',
'low': '412.40'
}
}
```
### 开发指南
#### 初始化环境
进入项目目录后运行
```
make init
```
提交代码时通过所有 `hooks` 检查即可
Raw data
{
"_id": null,
"home_page": "https://gitee.com/a_star/easyquotation",
"name": "snowland-easyquotation",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "China stock trade",
"author": "A.Star",
"author_email": "astar@snowland.ltd",
"download_url": "https://files.pythonhosted.org/packages/45/49/f4af5392604fcdc1c8b6dcceb59f594e0b5284aa87e59678b808fd401369/snowland-easyquotation-0.8.tar.gz",
"platform": null,
"description": "# easyquotation\r\n\r\n[![Package](https://img.shields.io/pypi/v/snowland-easyquotation.svg)](https://pypi.python.org/pypi/snowland-easyquotation)\r\n\r\n\r\n\u5feb\u901f\u83b7\u53d6\u65b0\u6d6a/\u817e\u8baf\u7684\u5168\u5e02\u573a\u884c\u60c5, \u7f51\u7edc\u6b63\u5e38\u7684\u60c5\u51b5\u4e0b\u53ea\u9700\u8981 `200+ms`\r\n\r\n### \u524d\u8a00\r\n* \u83b7\u53d6\u65b0\u6d6a\u7684\u514d\u8d39\u5b9e\u65f6\u884c\u60c5\r\n* \u83b7\u53d6\u817e\u8baf\u8d22\u7ecf\u7684\u514d\u8d39\u5b9e\u65f6\u884c\u60c5\r\n* \u83b7\u53d6\u96c6\u601d\u8def\u7684\u5206\u7ea7\u57fa\u91d1\u6570\u636e\r\n\r\n\r\n### requirements\r\n\r\n> Python 3.6+\r\n \r\n> pip install -r requirements.txt\r\n\r\n### \u5b89\u88c5\r\n\r\n```commandline\r\npip install easyquotation\r\n```\r\n\r\n\u4e5f\u53ef\u4ee5\u4e0b\u8f7d\u6e90\u7801\uff0c\u7136\u540e\u5b89\u88c5\r\n\r\n```commandline\r\npython setup.py install\r\n```\r\n\r\n#### \u5347\u7ea7\r\n\r\n```commandline\r\npip install easyquotation --upgrade\r\n```\r\n\r\n### \u7528\u6cd5\r\n\r\n#### \u5f15\u5165:\r\n\r\n```python\r\nimport easyquotation\r\n```\r\n\r\n#### \u9009\u62e9\u884c\u60c5\r\n\r\n```python\r\nquotation = easyquotation.use('sina') # \u65b0\u6d6a ['sina'] \u817e\u8baf ['tencent', 'qq'] \r\n```\r\n\r\n#### \u83b7\u53d6\u6240\u6709\u80a1\u7968\u884c\u60c5\r\n\r\n```python\r\nquotation.market_snapshot(prefix=True) # prefix \u53c2\u6570\u6307\u5b9a\u8fd4\u56de\u7684\u884c\u60c5\u5b57\u5178\u4e2d\u7684\u80a1\u7968\u4ee3\u7801 key \u662f\u5426\u5e26 sz/sh \u524d\u7f00\r\n```\r\n\r\n**return**\r\n\r\n```json\r\n {'sh000159': {'name': '\u56fd\u9645\u5b9e\u4e1a', # \u80a1\u7968\u540d\r\n 'buy': 8.87, # \u7ade\u4e70\u4ef7\r\n 'sell': 8.88, # \u7ade\u5356\u4ef7\r\n 'now': 8.88, # \u73b0\u4ef7\r\n 'open': 8.99, # \u5f00\u76d8\u4ef7\r\n 'close': 8.96, # \u6628\u65e5\u6536\u76d8\u4ef7\r\n 'high': 9.15, # \u4eca\u65e5\u6700\u9ad8\u4ef7\r\n 'low': 8.83, # \u4eca\u65e5\u6700\u4f4e\u4ef7\r\n 'turnover': 22545048, # \u4ea4\u6613\u80a1\u6570\r\n 'volume': 202704887.74\uff0c # \u4ea4\u6613\u91d1\u989d\r\n 'ask1': 8.88, # \u5356\u4e00\u4ef7\r\n 'ask1_volume': 111900, # \u5356\u4e00\u91cf\r\n 'ask2': 8.89,\r\n 'ask2_volume': 54700,\r\n 'bid1': 8.87, # \u4e70\u4e00\u4ef7\r\n 'bid1_volume': 21800, # \u4e70\u4e00\u91cf\r\n ...\r\n 'bid2': 8.86, \r\n 'bid2_volume': 78400,\r\n 'date': '2016-02-19',\r\n 'time': '14:30:00',\r\n ...},\r\n ......\r\n}\r\n```\r\n \r\n##### \u5355\u53ea\u80a1\u7968\r\n\r\n```\r\nquotation.real('162411') # \u652f\u6301\u76f4\u63a5\u6307\u5b9a\u524d\u7f00\uff0c\u5982 'sh000001'\r\n```\r\n\r\n##### \u591a\u53ea\u80a1\u7968\r\n\r\n```\r\nquotation.stocks(['000001', '162411']) \r\n```\r\n\r\n##### \u540c\u65f6\u83b7\u53d6\u6307\u6570\u548c\u884c\u60c5\r\n\r\n```\r\nquotation.stocks(['sh000001', 'sz000001'], prefix=True) \r\n```\r\n\r\n#### \u66f4\u65b0\u80a1\u7968\u4ee3\u7801\r\n\r\n```\r\neasyquotation.update_stock_codes()\r\n```\r\n\r\n\r\n#### \u9009\u62e9 [jsl](https://www.jisilu.cn)\uff08\u96c6\u601d\u8def\uff09 \u884c\u60c5\r\n\r\n```\r\nquotation = easyquotation.use('jsl') # ['jsl']\r\n```\r\n\r\n##### \u8bbe\u7f6e cookie (\u53ef\u9009)\r\n\r\n\u4e0d\u8bbe\u7f6e\u7684\u8bdd\u83b7\u53d6\u76f8\u5173\u6570\u636e\u6709\u9650\u5236\r\n\r\n```\r\nquotation.set_cookie('\u4ece\u6d4f\u89c8\u5668\u83b7\u53d6\u7684\u96c6\u601d\u5f55 Cookie')\r\n```\r\n\r\n##### \u83b7\u53d6\u5206\u7ea7\u57fa\u91d1\u4fe1\u606f\r\n\r\n```\r\nquotation.funda() # \u53c2\u6570\u53ef\u9009\u62e9\u5229\u7387\u3001\u6298\u4ef7\u7387\u3001\u4ea4\u6613\u91cf\u3001\u6709\u65e0\u4e0b\u6298\u3001\u662f\u5426\u6c38\u7eed\u6765\u8fc7\u6ee4\r\n\r\nquotation.fundb() # \u53c2\u6570\u5982\u4e0a\r\n```\r\n\r\n\u5bf9\u5e94\u7684\u5206\u7ea7 A \u6570\u636e\r\n\r\n**return**\r\n\r\n```\r\n{ 150020:\r\n{'abrate': '5:5',\r\n'calc_info': None,\r\n'coupon_descr': '+3.0%',\r\n'coupon_descr_s': '+3.0%',\r\n'fund_descr': '\u6bcf\u5e74\u7b2c\u4e00\u4e2a\u5de5\u4f5c\u65e5\u5b9a\u6298\uff0c\u65e0\u4e0b\u6298\uff0cA\u4e0d\u53c2\u4e0e\u4e0a\u6298\uff0c\u51c0\u503c<1\u5143\u65e0\u5b9a\u6298',\r\n'funda_amount': 178823,\r\n'funda_amount_increase': '0',\r\n'funda_amount_increase_rt': '0.00%',\r\n'funda_base_est_dis_rt': '2.27%',\r\n'funda_base_est_dis_rt_t1': '2.27%',\r\n'funda_base_est_dis_rt_t2': '-0.34%',\r\n'funda_base_est_dis_rt_tip': '',\r\n'funda_base_fund_id': '163109',\r\n'funda_coupon': '5.75',\r\n'funda_coupon_next': '4.75',\r\n'funda_current_price': '0.783',\r\n'funda_discount_rt': '24.75%',\r\n'funda_id': '150022',\r\n'funda_increase_rt': '0.00%',\r\n'funda_index_id': '399001',\r\n'funda_index_increase_rt': '0.00%',\r\n'funda_index_name': '\u6df1\u8bc1\u6210\u6307',\r\n'funda_left_year': '\u6c38\u7eed',\r\n'funda_lower_recalc_rt': '1.82%',\r\n'funda_name': '\u6df1\u6210\u6307A',\r\n'funda_nav_dt': '2015-09-14',\r\n'funda_profit_rt': '7.74%',\r\n'funda_profit_rt_next': '6.424%',\r\n'funda_value': '1.0405',\r\n'funda_volume': '0.00',\r\n'fundb_upper_recalc_rt': '244.35%',\r\n'fundb_upper_recalc_rt_info': '\u6df1\u6210\u6307A\u4e0d\u53c2\u4e0e\u4e0a\u6298',\r\n'last_time': '09:18:22',\r\n'left_recalc_year': '0.30411',\r\n'lower_recalc_profit_rt': '-',\r\n'next_recalc_dt': '<span style=\"font-style:italic\">2016-01-04</span>',\r\n'owned': 0,\r\n'status_cd': 'N'}>'}}\r\n```\r\n\r\n##### \u5206\u7ea7\u57fa\u91d1\u5957\u5229\u63a5\u53e3\r\n\r\n```\r\nquotation.fundarb(jsl_username, jsl_password, avolume=100, bvolume=100, ptype='price')\r\n```\r\n\r\n```\r\njsl_username: \u96c6\u601d\u5f55\u7528\u6237\u540d\r\njsl_password: \u96c6\u601d\u8def\u767b\u5f55\u5bc6\u7801\r\navolume: A\u6210\u4ea4\u989d\uff0c\u5355\u4f4d\u767e\u4e07\r\nbvolume: B\u6210\u4ea4\u989d\uff0c\u5355\u4f4d\u767e\u4e07\r\nptype: \u6ea2\u4ef7\u8ba1\u7b97\u65b9\u5f0f\uff0cprice=\u73b0\u4ef7\uff0cbuy=\u4e70\u4e00\uff0csell=\u5356\u4e00\r\n```\r\n\r\n**return** \r\n```\r\n{\r\n \"165511\":{\r\n 'base_fund_id': '165511', # \u6bcd\u57fa\u91d1\u4ee3\u7801\r\n 'AB_price': '\u73b0\u4ef7A/B : 1.008/1.329',\r\n 'a_profit_rt_next': '4.705',\r\n 'a_ratio': 4,\r\n 'abrate': '4:6',\r\n 'apply_fee': '0',\r\n 'apply_fee_tip': '0',\r\n 'apply_sell': '-0.59',\r\n 'asset_ratio': '95%',\r\n 'asset_ratio_last': '99%',\r\n 'asset_ratio_num': '95.00',\r\n 'b_est_val': '1.340',\r\n 'b_gangan': '1.502',\r\n 'b_ratio': 6,\r\n 'base_est_dis_rt': '-0.56%',\r\n 'base_est_val': '1.2073',\r\n 'base_fund_nm': '\u4fe1\u8bda500',\r\n 'base_lower_recalc_rt': '54.15%',\r\n 'base_nav': '1.1970',\r\n 'base_nav_dt': '2016-04-13',\r\n 'buy1A': '1.007',\r\n 'buy1B': '1.329',\r\n 'buy1_amountA': '0.201',\r\n 'buy1_amountB': '7.123',\r\n 'buy_redeem': '-0.51',\r\n 'calc_info': None,\r\n 'coupon': '0.00%',\r\n 'coupon_next': '4.700',\r\n 'est_dis_rt': '-0.55%',\r\n 'est_time': '2016-04-14 15:10:05',\r\n 'fundA_amount': '6667',\r\n 'fundA_amount_increase': '-51',\r\n 'fundA_amount_increase_rt': '-0.76%',\r\n 'fundA_amount_tip': '2016-04-14 A\u7c7b\u603b\u4efd\u989d6667.000\u4e07\u4efd\uff0c\u4efd\u989d\u589e\u957f-0.76%',\r\n 'fundA_id': '150028',\r\n 'fundA_last_dt': '2016-04-14',\r\n 'fundA_last_time': '14:57:02',\r\n 'fundA_nav': '1.0090',\r\n 'fundA_nav_dt': '2016-04-13',\r\n 'fundA_nm': '\u4e2d\u8bc1500A',\r\n 'fundA_stock_volume': '28.2446',\r\n 'fundA_stock_volume_tip': 'A\u7c7b\u603b\u4efd\u989d6667.000\u4e07\u4efd, \u6210\u4ea428\u4e07\u4efd',\r\n 'fundA_turnover_rt': '0.42%',\r\n 'fundA_volume': '28.46',\r\n 'fundB_amount': 10000.5,\r\n 'fundB_amount_increase': '-76',\r\n 'fundB_amount_tip': '2016-04-14 B\u7c7b\u603b\u4efd\u989d10000\u4e07\u4efd\uff0c\u4efd\u989d\u589e\u957f-0.76%',\r\n 'fundB_id': '150029',\r\n 'fundB_last_dt': '2016-04-14',\r\n 'fundB_last_time': '15:00:27',\r\n 'fundB_nav': '1.3220',\r\n 'fundB_nav_dt': '2016-04-13',\r\n 'fundB_nm': '\u4e2d\u8bc1500B',\r\n 'fundB_stock_volume': '255.5280',\r\n 'fundB_stock_volume_tip': 'B\u7c7b\u603b\u4efd\u989d10000\u4e07\u4efd, \u6210\u4ea4256\u4e07\u4efd',\r\n 'fundB_turnover_rt': '2.56%',\r\n 'fundB_volume': '337.24',\r\n 'fund_company_nm': '\u4fe1\u8bda\u57fa\u91d1',\r\n 'funda_name_tip': '\u4e0b\u671f\u5229\u7387\uff1a4.70\uff0c\u4fee\u6b63\u6536\u76ca\u7387\uff1a4.71%',\r\n 'idx_incr_rt': '0.91%',\r\n 'increase_rtA': '-0.10%',\r\n 'increase_rtB': '1.06%',\r\n 'index_id': '399905',\r\n 'index_nm': '\u4e2d\u8bc1 500',\r\n 'is_est_val': 1,\r\n 'is_last_nav': 1,\r\n 'lower_recalc_rt': '54.15',\r\n 'maturity_dt': '-',\r\n 'merge_price': '1.2006',\r\n 'min_apply_amount': None,\r\n 'notes': 'http://www.xcfunds.com/funds_2012/165511/fundinfor.shtml\\r\\n',\r\n 'ownedA': 0,\r\n 'ownedM': 1,\r\n 'priceA': '1.008',\r\n 'priceB': '1.329',\r\n 'real_idx_increase_rt': '0.91',\r\n 'recalc_to': None,\r\n 'redeem_fee': '0.5%',\r\n 'redeem_fee_tip': '0.5%',\r\n 'sell1A': '1.008',\r\n 'sell1B': '1.330',\r\n 'sell1_amountA': '7.132',\r\n 'sell1_amountB': '16.820',\r\n 'status_cd': 'N'\r\n }\r\n}\r\n```\r\n\r\n##### \u6307\u6570ETF\u67e5\u8be2\u63a5\u53e3\r\n\r\n**TIP :** \u5c1a\u672a\u5305\u542b\u9ec4\u91d1ETF\u548c\u8d27\u5e01ETF\r\n\r\n*[\u96c6\u601d\u5f55ETF\u6e90\u7f51\u9875](https://www.jisilu.cn/data/etf/#tlink_2)*\r\n\r\n```\r\nquotation.etfindex(index_id=\"\", min_volume=0, max_discount=None, min_discount=None)\r\n```\r\n\r\n**return**\r\n\r\n```\r\n{\r\n \"510050\": {\r\n \"fund_id\": \"510050\", # \u4ee3\u7801\r\n \"fund_nm\": \"50ETF\", # \u540d\u79f0\r\n \"price\": \"2.066\", # \u73b0\u4ef7\r\n \"increase_rt\": \"0.34%\", # \u6da8\u5e45\r\n \"volume\": \"71290.96\", # \u6210\u4ea4\u989d(\u4e07\u5143)\r\n \"index_nm\": \"\u4e0a\u8bc150\", # \u6307\u6570\r\n \"pe\": \"9.038\", # \u6307\u6570PE\r\n \"pb\": \"1.151\", # \u6307\u6570PB\r\n \"index_increase_rt\": \"0.45%\", # \u6307\u6570\u6da8\u5e45\r\n \"estimate_value\": \"2.0733\", # \u4f30\u503c\r\n \"fund_nav\": \"2.0730\", # \u51c0\u503c\r\n \"nav_dt\": \"2016-03-11\", # \u51c0\u503c\u65e5\u671f\r\n \"discount_rt\": \"-0.34%\", # \u6ea2\u4ef7\u7387\r\n \"creation_unit\": \"90\", # \u6700\u5c0f\u7533\u8d4e\u5355\u4f4d(\u4e07\u4efd)\r\n \"amount\": \"1315800\", # \u4efd\u989d\r\n \"unit_total\": \"271.84\", # \u89c4\u6a21(\u4ebf\u5143)\r\n \"index_id\": \"000016\", # \u6307\u6570\u4ee3\u7801\r\n \"last_time\": \"15:00:00\", # \u4ef7\u683c\u6700\u540e\u65f6\u95f4(\u672a\u786e\u5b9a)\r\n \"last_est_time\": \"23:50:02\", # \u4f30\u503c\u6700\u540e\u65f6\u95f4(\u672a\u786e\u5b9a)\r\n }\r\n}\r\n```\r\n\r\n\r\n##### \u5206\u6570\u56fe\r\n\r\n\r\n*[\u817e\u8baf\u5206\u65f6\u56fe\u5730\u5740](http://data.gtimg.cn/flashdata/hushen/minute/sz000001.js)*\r\n\r\n```python\r\n\r\nquotation = easyquotation.use(\"timekline\")\r\ndata = quotation.real(['603828'], prefix=True)\r\n\r\n```\r\n\r\n**return**\r\n\r\n```\r\n{\r\n 'sh603828': {\r\n 'date': '170721', #\u65e5\u671f \r\n 'time_data': {\r\n '201707210930': ['0930', '19.42', '61'], # [\u65f6\u95f4, \u5f53\u524d\u4ef7, \u4e0a\u4e00\u5206\u949f\u5230\u8fd9\u4e00\u5206\u949f\u4e4b\u95f4\u7684\u6210\u4ea4\u6570\u91cf]\r\n '201707210931': ['0931', '19.42','122'], \r\n '201707210932': ['0932', '19.43', '123'], \r\n '201707210933': ['0933', '19.48', '125'], \r\n '201707210934': ['0934', '19.49', '133'], \r\n '201707210935': ['0935', '19.48', '161'], \r\n ...\r\n }\r\n}\r\n```\r\n\r\n##### \u6e2f\u80a1\u65e5k\u7ebf\u56fe\r\n*[\u817e\u8baf\u65e5k\u7ebf\u56fe](http://web.ifzq.gtimg.cn/appstock/app/hkfqkline/get?_var=kline_dayqfq¶m=hk00700,day,,,350,qfq&r=0.7773272375526847)*\r\n\r\n```python\r\n\r\nimport easyquotation\r\nquotation = easyquotation.use(\"daykline\")\r\ndata = quotation.real(['00001','00700'])\r\nprint(data)\r\n\r\n```\r\n*return*\r\n```\r\n{\r\n '00001': [\r\n ['2017-10-09', '352.00', '349.00', '353.00', '348.60', '13455864.00'], # [\u65e5\u671f, \u4eca\u5f00, \u4eca\u6536, \u6700\u9ad8, \u6700\u4f4e, \u6210\u4ea4\u91cf ]\r\n ['2017-10-10', '350.80', '351.20', '352.60', '349.80', '10088970.00'],\r\n ]\r\n '00700':[\r\n \r\n ] \r\n }\r\n}\r\n```\r\n\r\n##### \u817e\u8baf\u6e2f\u80a1\u65f6\u65f6\u884c\u60c5 \r\n*[\u817e\u8baf\u63a7\u80a1\u65f6\u65f6\u884c\u60c5](http://sqt.gtimg.cn/utf8/q=r_hk00700)*\r\n```python\r\n\r\nimport easyquotation\r\nquotation = easyquotation.use(\"hkquote\")\r\ndata = quotation.real(['00001','00700'])\r\nprint(data)\r\n```\r\n\r\n```\r\n{\r\n '00001': \r\n {\r\n 'stock_code': '00001', # \u80a1\u7968\u4ee3\u7801\r\n 'lotSize': '\"100', # \u6bcf\u624b\u6570\u91cf\r\n 'name': '\u957f\u548c', # \u80a1\u7968\u540d\u79f0\r\n 'price': '97.20', # \u80a1\u7968\u5f53\u524d\u4ef7\u683c\r\n 'lastPrice': '97.75', # \u80a1\u7968\u6628\u5929\u6536\u76d8\u4ef7\u683c\r\n 'openPrice': '97.75', # \u80a1\u7968\u4eca\u5929\u5f00\u76d8\u4ef7\u683c\r\n 'amount': '1641463.0', # \u80a1\u7968\u6210\u4ea4\u91cf \r\n 'time': '2017/11/29 15:38:58', # \u5f53\u524d\u65f6\u95f4\r\n 'high': '98.05', # \u5f53\u5929\u6700\u9ad8\u4ef7\u683c\r\n 'low': '97.15' # \u5f53\u5929\u6700\u4f4e\u4ef7\u683c\r\n }, \r\n '00700': \r\n {\r\n 'stock_code': '00700', \r\n 'lotSize': '\"100',\r\n 'name': '\u817e\u8baf\u63a7\u80a1', \r\n 'price': '413.20', \r\n 'lastPrice': '419.20', \r\n 'openPrice': '422.20', \r\n 'amount': '21351010.0', \r\n 'time': '2017/11/29 15:39:01', \r\n 'high': '422.80',\r\n 'low': '412.40'\r\n }\r\n}\r\n```\r\n\r\n### \u5f00\u53d1\u6307\u5357\r\n\r\n#### \u521d\u59cb\u5316\u73af\u5883\r\n\r\n\u8fdb\u5165\u9879\u76ee\u76ee\u5f55\u540e\u8fd0\u884c \r\n\r\n```\r\nmake init\r\n```\r\n\r\n\u63d0\u4ea4\u4ee3\u7801\u65f6\u901a\u8fc7\u6240\u6709 `hooks` \u68c0\u67e5\u5373\u53ef\r\n",
"bugtrack_url": null,
"license": "Apache Software License",
"summary": "A utility for Fetch China Stock Info",
"version": "0.8",
"project_urls": {
"Homepage": "https://gitee.com/a_star/easyquotation"
},
"split_keywords": [
"china",
"stock",
"trade"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "50a8271e3f49803f5a200682bf0ca274f7a4ea5013006a9f0ecb98cae7778c13",
"md5": "a75b5f721e0d5eaafacce66c0f11f443",
"sha256": "d823798da5a3998a4dbe45b03a8635693516847d1cb44420939945c694ae765b"
},
"downloads": -1,
"filename": "snowland_easyquotation-0.8-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a75b5f721e0d5eaafacce66c0f11f443",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 35422,
"upload_time": "2023-06-04T13:04:39",
"upload_time_iso_8601": "2023-06-04T13:04:39.390899Z",
"url": "https://files.pythonhosted.org/packages/50/a8/271e3f49803f5a200682bf0ca274f7a4ea5013006a9f0ecb98cae7778c13/snowland_easyquotation-0.8-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "4549f4af5392604fcdc1c8b6dcceb59f594e0b5284aa87e59678b808fd401369",
"md5": "164a32f1fa1e5748e05a0d727ad478ac",
"sha256": "f046f5e4aab03418e5a9e1b1d25135072f923bcd587f5edb9d0ad1f1b626d0d4"
},
"downloads": -1,
"filename": "snowland-easyquotation-0.8.tar.gz",
"has_sig": false,
"md5_digest": "164a32f1fa1e5748e05a0d727ad478ac",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 39017,
"upload_time": "2023-06-04T13:04:43",
"upload_time_iso_8601": "2023-06-04T13:04:43.103486Z",
"url": "https://files.pythonhosted.org/packages/45/49/f4af5392604fcdc1c8b6dcceb59f594e0b5284aa87e59678b808fd401369/snowland-easyquotation-0.8.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-06-04 13:04:43",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "snowland-easyquotation"
}