easyquotation


Nameeasyquotation JSON
Version 0.7.5 PyPI version JSON
download
home_pagehttps://github.com/shidenggui/easyquotation
SummaryA utility for Fetch China Stock Info
upload_time2022-01-22 12:47:25
maintainer
docs_urlNone
authorshidenggui
requires_python
licenseBSD
keywords china stock trade
VCS
bugtrack_url
requirements requests
Travis-CI
coveralls test coverage
            # easyquotation

[![Package](https://img.shields.io/pypi/v/easyquotation.svg)](https://pypi.python.org/pypi/easyquotation)
[![Travis](https://img.shields.io/travis/shidenggui/easyquotation.svg)](https://travis-ci.org/shidenggui/easyquotation)
[![License](https://img.shields.io/github/license/shidenggui/easyquotation.svg)](https://github.com/shidenggui/easyquotation/blob/master/LICENSE)


快速获取新浪/腾讯的全市场行情, 网络正常的情况下只需要 `200+ms`

### 前言
* 获取新浪的免费实时行情
* 获取腾讯财经的免费实时行情
* 获取集思路的分级基金数据

### 微信群以及公众号

欢迎大家扫码关注公众号「食灯鬼」,一起交流。进群可通过菜单加我好友,备注量化。

![公众号二维码](https://gitee.com/shidenggui/assets/raw/master/uPic/mp-qr.png)

若二维码因 Github 网络无法打开,请点击[公众号二维码](https://gitee.com/shidenggui/assets/raw/master/uPic/mp-qr.png)直接打开图片。

### Author

**easyquotation** © [shidenggui](https://github.com/shidenggui), Released under the [MIT](./LICENSE) License.<br>

> Blog [@shidenggui](https://shidenggui.com) · Weibo [@食灯鬼](https://www.weibo.com/u/1651274491) · Twitter [@shidenggui](https://twitter.com/shidenggui)
>


### 其他作品

* [easytrader 股票程序化交易库](https://github.com/shidenggui/easytrader)
* [easyquant 简单的量化框架](https://github.com/shidenggui/easyqutant)
* [大数据网络小说推荐系统 - 推书君](https://www.tuishujun.com)
* [中文独立个人博客导航 - bloghub.fun](https://bloghub.fun)

### requirements

> Python 3.6+
 
> pip install -r requirements.txt

### 安装

```python
pip install easyquotation
```

也可以下载源码,然后安装

```python
python setup.py install
```

#### 升级

```python
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**

```python
 {'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&param=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://github.com/shidenggui/easyquotation",
    "name": "easyquotation",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "China stock trade",
    "author": "shidenggui",
    "author_email": "longlyshidenggui@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/22/84/a4b65e0d01ae93bd1719da50979ebf03b440911d8da16931728d89eedb4d/easyquotation-0.7.5.tar.gz",
    "platform": "",
    "description": "# easyquotation\n\n[![Package](https://img.shields.io/pypi/v/easyquotation.svg)](https://pypi.python.org/pypi/easyquotation)\n[![Travis](https://img.shields.io/travis/shidenggui/easyquotation.svg)](https://travis-ci.org/shidenggui/easyquotation)\n[![License](https://img.shields.io/github/license/shidenggui/easyquotation.svg)](https://github.com/shidenggui/easyquotation/blob/master/LICENSE)\n\n\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`\n\n### \u524d\u8a00\n* \u83b7\u53d6\u65b0\u6d6a\u7684\u514d\u8d39\u5b9e\u65f6\u884c\u60c5\n* \u83b7\u53d6\u817e\u8baf\u8d22\u7ecf\u7684\u514d\u8d39\u5b9e\u65f6\u884c\u60c5\n* \u83b7\u53d6\u96c6\u601d\u8def\u7684\u5206\u7ea7\u57fa\u91d1\u6570\u636e\n\n### \u5fae\u4fe1\u7fa4\u4ee5\u53ca\u516c\u4f17\u53f7\n\n\u6b22\u8fce\u5927\u5bb6\u626b\u7801\u5173\u6ce8\u516c\u4f17\u53f7\u300c\u98df\u706f\u9b3c\u300d\uff0c\u4e00\u8d77\u4ea4\u6d41\u3002\u8fdb\u7fa4\u53ef\u901a\u8fc7\u83dc\u5355\u52a0\u6211\u597d\u53cb\uff0c\u5907\u6ce8\u91cf\u5316\u3002\n\n![\u516c\u4f17\u53f7\u4e8c\u7ef4\u7801](https://gitee.com/shidenggui/assets/raw/master/uPic/mp-qr.png)\n\n\u82e5\u4e8c\u7ef4\u7801\u56e0 Github \u7f51\u7edc\u65e0\u6cd5\u6253\u5f00\uff0c\u8bf7\u70b9\u51fb[\u516c\u4f17\u53f7\u4e8c\u7ef4\u7801](https://gitee.com/shidenggui/assets/raw/master/uPic/mp-qr.png)\u76f4\u63a5\u6253\u5f00\u56fe\u7247\u3002\n\n### Author\n\n**easyquotation** \u00a9 [shidenggui](https://github.com/shidenggui), Released under the [MIT](./LICENSE) License.<br>\n\n> Blog [@shidenggui](https://shidenggui.com) \u00b7 Weibo [@\u98df\u706f\u9b3c](https://www.weibo.com/u/1651274491) \u00b7 Twitter [@shidenggui](https://twitter.com/shidenggui)\n>\n\n\n### \u5176\u4ed6\u4f5c\u54c1\n\n* [easytrader \u80a1\u7968\u7a0b\u5e8f\u5316\u4ea4\u6613\u5e93](https://github.com/shidenggui/easytrader)\n* [easyquant \u7b80\u5355\u7684\u91cf\u5316\u6846\u67b6](https://github.com/shidenggui/easyqutant)\n* [\u5927\u6570\u636e\u7f51\u7edc\u5c0f\u8bf4\u63a8\u8350\u7cfb\u7edf - \u63a8\u4e66\u541b](https://www.tuishujun.com)\n* [\u4e2d\u6587\u72ec\u7acb\u4e2a\u4eba\u535a\u5ba2\u5bfc\u822a - bloghub.fun](https://bloghub.fun)\n\n### requirements\n\n> Python 3.6+\n \n> pip install -r requirements.txt\n\n### \u5b89\u88c5\n\n```python\npip install easyquotation\n```\n\n\u4e5f\u53ef\u4ee5\u4e0b\u8f7d\u6e90\u7801\uff0c\u7136\u540e\u5b89\u88c5\n\n```python\npython setup.py install\n```\n\n#### \u5347\u7ea7\n\n```python\npip install easyquotation --upgrade\n```\n\n### \u7528\u6cd5\n\n#### \u5f15\u5165:\n\n```python\nimport easyquotation\n```\n\n#### \u9009\u62e9\u884c\u60c5\n\n```python\nquotation = easyquotation.use('sina') # \u65b0\u6d6a ['sina'] \u817e\u8baf ['tencent', 'qq'] \n```\n\n#### \u83b7\u53d6\u6240\u6709\u80a1\u7968\u884c\u60c5\n\n```python\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\n```\n\n**return**\n\n```python\n {'sh000159': {'name': '\u56fd\u9645\u5b9e\u4e1a', # \u80a1\u7968\u540d\n  'buy': 8.87, # \u7ade\u4e70\u4ef7\n  'sell': 8.88, # \u7ade\u5356\u4ef7\n  'now': 8.88, # \u73b0\u4ef7\n  'open': 8.99, # \u5f00\u76d8\u4ef7\n  'close': 8.96, # \u6628\u65e5\u6536\u76d8\u4ef7\n  'high': 9.15, # \u4eca\u65e5\u6700\u9ad8\u4ef7\n  'low': 8.83, # \u4eca\u65e5\u6700\u4f4e\u4ef7\n  'turnover': 22545048, # \u4ea4\u6613\u80a1\u6570\n  'volume': 202704887.74\uff0c # \u4ea4\u6613\u91d1\u989d\n  'ask1': 8.88, # \u5356\u4e00\u4ef7\n  'ask1_volume': 111900, # \u5356\u4e00\u91cf\n  'ask2': 8.89,\n  'ask2_volume': 54700,\n  'bid1': 8.87, # \u4e70\u4e00\u4ef7\n  'bid1_volume': 21800, # \u4e70\u4e00\u91cf\n  ...\n  'bid2': 8.86, \n  'bid2_volume': 78400,\n  'date': '2016-02-19',\n  'time': '14:30:00',\n  ...},\n  ......\n}\n```\n \n##### \u5355\u53ea\u80a1\u7968\n\n```\nquotation.real('162411') # \u652f\u6301\u76f4\u63a5\u6307\u5b9a\u524d\u7f00\uff0c\u5982 'sh000001'\n```\n\n##### \u591a\u53ea\u80a1\u7968\n\n```\nquotation.stocks(['000001', '162411']) \n```\n\n##### \u540c\u65f6\u83b7\u53d6\u6307\u6570\u548c\u884c\u60c5\n\n```\nquotation.stocks(['sh000001', 'sz000001'], prefix=True) \n```\n\n#### \u66f4\u65b0\u80a1\u7968\u4ee3\u7801\n\n```\neasyquotation.update_stock_codes()\n```\n\n\n#### \u9009\u62e9 [jsl](https://www.jisilu.cn)\uff08\u96c6\u601d\u8def\uff09 \u884c\u60c5\n\n```\nquotation = easyquotation.use('jsl') # ['jsl']\n```\n\n##### \u8bbe\u7f6e cookie (\u53ef\u9009)\n\n\u4e0d\u8bbe\u7f6e\u7684\u8bdd\u83b7\u53d6\u76f8\u5173\u6570\u636e\u6709\u9650\u5236\n\n```\nquotation.set_cookie('\u4ece\u6d4f\u89c8\u5668\u83b7\u53d6\u7684\u96c6\u601d\u5f55 Cookie')\n```\n\n##### \u83b7\u53d6\u5206\u7ea7\u57fa\u91d1\u4fe1\u606f\n\n```\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\n\nquotation.fundb() # \u53c2\u6570\u5982\u4e0a\n```\n\n\u5bf9\u5e94\u7684\u5206\u7ea7 A \u6570\u636e\n\n**return**\n\n```\n{ 150020:\n{'abrate': '5:5',\n'calc_info': None,\n'coupon_descr': '+3.0%',\n'coupon_descr_s': '+3.0%',\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',\n'funda_amount': 178823,\n'funda_amount_increase': '0',\n'funda_amount_increase_rt': '0.00%',\n'funda_base_est_dis_rt': '2.27%',\n'funda_base_est_dis_rt_t1': '2.27%',\n'funda_base_est_dis_rt_t2': '-0.34%',\n'funda_base_est_dis_rt_tip': '',\n'funda_base_fund_id': '163109',\n'funda_coupon': '5.75',\n'funda_coupon_next': '4.75',\n'funda_current_price': '0.783',\n'funda_discount_rt': '24.75%',\n'funda_id': '150022',\n'funda_increase_rt': '0.00%',\n'funda_index_id': '399001',\n'funda_index_increase_rt': '0.00%',\n'funda_index_name': '\u6df1\u8bc1\u6210\u6307',\n'funda_left_year': '\u6c38\u7eed',\n'funda_lower_recalc_rt': '1.82%',\n'funda_name': '\u6df1\u6210\u6307A',\n'funda_nav_dt': '2015-09-14',\n'funda_profit_rt': '7.74%',\n'funda_profit_rt_next': '6.424%',\n'funda_value': '1.0405',\n'funda_volume': '0.00',\n'fundb_upper_recalc_rt': '244.35%',\n'fundb_upper_recalc_rt_info': '\u6df1\u6210\u6307A\u4e0d\u53c2\u4e0e\u4e0a\u6298',\n'last_time': '09:18:22',\n'left_recalc_year': '0.30411',\n'lower_recalc_profit_rt': '-',\n'next_recalc_dt': '<span style=\"font-style:italic\">2016-01-04</span>',\n'owned': 0,\n'status_cd': 'N'}>'}}\n```\n\n##### \u5206\u7ea7\u57fa\u91d1\u5957\u5229\u63a5\u53e3\n\n```\nquotation.fundarb(jsl_username, jsl_password, avolume=100, bvolume=100, ptype='price')\n```\n\n```\njsl_username: \u96c6\u601d\u5f55\u7528\u6237\u540d\njsl_password: \u96c6\u601d\u8def\u767b\u5f55\u5bc6\u7801\navolume: A\u6210\u4ea4\u989d\uff0c\u5355\u4f4d\u767e\u4e07\nbvolume: B\u6210\u4ea4\u989d\uff0c\u5355\u4f4d\u767e\u4e07\nptype: \u6ea2\u4ef7\u8ba1\u7b97\u65b9\u5f0f\uff0cprice=\u73b0\u4ef7\uff0cbuy=\u4e70\u4e00\uff0csell=\u5356\u4e00\n```\n\n**return** \n```\n{\n    \"165511\":{\n        'base_fund_id': '165511',                         # \u6bcd\u57fa\u91d1\u4ee3\u7801\n        'AB_price': '\u73b0\u4ef7A/B : 1.008/1.329',\n        'a_profit_rt_next': '4.705',\n        'a_ratio': 4,\n        'abrate': '4:6',\n        'apply_fee': '0',\n        'apply_fee_tip': '0',\n        'apply_sell': '-0.59',\n        'asset_ratio': '95%',\n        'asset_ratio_last': '99%',\n        'asset_ratio_num': '95.00',\n        'b_est_val': '1.340',\n        'b_gangan': '1.502',\n        'b_ratio': 6,\n        'base_est_dis_rt': '-0.56%',\n        'base_est_val': '1.2073',\n        'base_fund_nm': '\u4fe1\u8bda500',\n        'base_lower_recalc_rt': '54.15%',\n        'base_nav': '1.1970',\n        'base_nav_dt': '2016-04-13',\n        'buy1A': '1.007',\n        'buy1B': '1.329',\n        'buy1_amountA': '0.201',\n        'buy1_amountB': '7.123',\n        'buy_redeem': '-0.51',\n        'calc_info': None,\n        'coupon': '0.00%',\n        'coupon_next': '4.700',\n        'est_dis_rt': '-0.55%',\n        'est_time': '2016-04-14 15:10:05',\n        'fundA_amount': '6667',\n        'fundA_amount_increase': '-51',\n        'fundA_amount_increase_rt': '-0.76%',\n        'fundA_amount_tip': '2016-04-14 A\u7c7b\u603b\u4efd\u989d6667.000\u4e07\u4efd\uff0c\u4efd\u989d\u589e\u957f-0.76%',\n        'fundA_id': '150028',\n        'fundA_last_dt': '2016-04-14',\n        'fundA_last_time': '14:57:02',\n        'fundA_nav': '1.0090',\n        'fundA_nav_dt': '2016-04-13',\n        'fundA_nm': '\u4e2d\u8bc1500A',\n        'fundA_stock_volume': '28.2446',\n        'fundA_stock_volume_tip': 'A\u7c7b\u603b\u4efd\u989d6667.000\u4e07\u4efd, \u6210\u4ea428\u4e07\u4efd',\n        'fundA_turnover_rt': '0.42%',\n        'fundA_volume': '28.46',\n        'fundB_amount': 10000.5,\n        'fundB_amount_increase': '-76',\n        'fundB_amount_tip': '2016-04-14 B\u7c7b\u603b\u4efd\u989d10000\u4e07\u4efd\uff0c\u4efd\u989d\u589e\u957f-0.76%',\n        'fundB_id': '150029',\n        'fundB_last_dt': '2016-04-14',\n        'fundB_last_time': '15:00:27',\n        'fundB_nav': '1.3220',\n        'fundB_nav_dt': '2016-04-13',\n        'fundB_nm': '\u4e2d\u8bc1500B',\n        'fundB_stock_volume': '255.5280',\n        'fundB_stock_volume_tip': 'B\u7c7b\u603b\u4efd\u989d10000\u4e07\u4efd, \u6210\u4ea4256\u4e07\u4efd',\n        'fundB_turnover_rt': '2.56%',\n        'fundB_volume': '337.24',\n        'fund_company_nm': '\u4fe1\u8bda\u57fa\u91d1',\n        'funda_name_tip': '\u4e0b\u671f\u5229\u7387\uff1a4.70\uff0c\u4fee\u6b63\u6536\u76ca\u7387\uff1a4.71%',\n        'idx_incr_rt': '0.91%',\n        'increase_rtA': '-0.10%',\n        'increase_rtB': '1.06%',\n        'index_id': '399905',\n        'index_nm': '\u4e2d\u8bc1 500',\n        'is_est_val': 1,\n        'is_last_nav': 1,\n        'lower_recalc_rt': '54.15',\n        'maturity_dt': '-',\n        'merge_price': '1.2006',\n        'min_apply_amount': None,\n        'notes': 'http://www.xcfunds.com/funds_2012/165511/fundinfor.shtml\\r\\n',\n        'ownedA': 0,\n        'ownedM': 1,\n        'priceA': '1.008',\n        'priceB': '1.329',\n        'real_idx_increase_rt': '0.91',\n        'recalc_to': None,\n        'redeem_fee': '0.5%',\n        'redeem_fee_tip': '0.5%',\n        'sell1A': '1.008',\n        'sell1B': '1.330',\n        'sell1_amountA': '7.132',\n        'sell1_amountB': '16.820',\n        'status_cd': 'N'\n    }\n}\n```\n\n##### \u6307\u6570ETF\u67e5\u8be2\u63a5\u53e3\n\n**TIP :** \u5c1a\u672a\u5305\u542b\u9ec4\u91d1ETF\u548c\u8d27\u5e01ETF\n\n*[\u96c6\u601d\u5f55ETF\u6e90\u7f51\u9875](https://www.jisilu.cn/data/etf/#tlink_2)*\n\n```\nquotation.etfindex(index_id=\"\", min_volume=0, max_discount=None, min_discount=None)\n```\n\n**return**\n\n```\n{\n    \"510050\": {\n        \"fund_id\": \"510050\",                # \u4ee3\u7801\n        \"fund_nm\": \"50ETF\",                 # \u540d\u79f0\n        \"price\": \"2.066\",                   # \u73b0\u4ef7\n        \"increase_rt\": \"0.34%\",             # \u6da8\u5e45\n        \"volume\": \"71290.96\",               # \u6210\u4ea4\u989d(\u4e07\u5143)\n        \"index_nm\": \"\u4e0a\u8bc150\",                # \u6307\u6570\n        \"pe\": \"9.038\",                      # \u6307\u6570PE\n        \"pb\": \"1.151\",                      # \u6307\u6570PB\n        \"index_increase_rt\": \"0.45%\",       # \u6307\u6570\u6da8\u5e45\n        \"estimate_value\": \"2.0733\",         # \u4f30\u503c\n        \"fund_nav\": \"2.0730\",               # \u51c0\u503c\n        \"nav_dt\": \"2016-03-11\",             # \u51c0\u503c\u65e5\u671f\n        \"discount_rt\": \"-0.34%\",            # \u6ea2\u4ef7\u7387\n        \"creation_unit\": \"90\",              # \u6700\u5c0f\u7533\u8d4e\u5355\u4f4d(\u4e07\u4efd)\n        \"amount\": \"1315800\",                # \u4efd\u989d\n        \"unit_total\": \"271.84\",             # \u89c4\u6a21(\u4ebf\u5143)\n        \"index_id\": \"000016\",               # \u6307\u6570\u4ee3\u7801\n        \"last_time\": \"15:00:00\",            # \u4ef7\u683c\u6700\u540e\u65f6\u95f4(\u672a\u786e\u5b9a)\n        \"last_est_time\": \"23:50:02\",        # \u4f30\u503c\u6700\u540e\u65f6\u95f4(\u672a\u786e\u5b9a)\n    }\n}\n```\n\n\n##### \u5206\u6570\u56fe\n\n\n*[\u817e\u8baf\u5206\u65f6\u56fe\u5730\u5740](http://data.gtimg.cn/flashdata/hushen/minute/sz000001.js)*\n\n```python\n\nquotation = easyquotation.use(\"timekline\")\ndata = quotation.real(['603828'], prefix=True)\n\n```\n\n**return**\n\n```\n{\n   'sh603828': {\n        'date': '170721',  #\u65e5\u671f \n        'time_data': {\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]\n            '201707210931': ['0931', '19.42','122'], \n            '201707210932': ['0932', '19.43', '123'], \n            '201707210933': ['0933', '19.48', '125'], \n            '201707210934': ['0934', '19.49', '133'], \n            '201707210935': ['0935', '19.48', '161'], \n            ...\n    }\n}\n```\n\n##### \u6e2f\u80a1\u65e5k\u7ebf\u56fe\n*[\u817e\u8baf\u65e5k\u7ebf\u56fe](http://web.ifzq.gtimg.cn/appstock/app/hkfqkline/get?_var=kline_dayqfq&param=hk00700,day,,,350,qfq&r=0.7773272375526847)*\n\n```python\n\nimport easyquotation\nquotation  = easyquotation.use(\"daykline\")\ndata = quotation.real(['00001','00700'])\nprint(data)\n\n```\n*return*\n```\n{\n    '00001': [\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 ]\n                ['2017-10-10', '350.80', '351.20', '352.60', '349.80', '10088970.00'],\n               ]\n    '00700':[\n        \n    ]           \n     }\n}\n```\n\n##### \u817e\u8baf\u6e2f\u80a1\u65f6\u65f6\u884c\u60c5 \n*[\u817e\u8baf\u63a7\u80a1\u65f6\u65f6\u884c\u60c5](http://sqt.gtimg.cn/utf8/q=r_hk00700)*\n```python\n\nimport easyquotation\nquotation = easyquotation.use(\"hkquote\")\ndata = quotation.real(['00001','00700'])\nprint(data)\n```\n\n```\n{\n    '00001': \n        {\n            'stock_code': '00001', # \u80a1\u7968\u4ee3\u7801\n            'lotSize': '\"100', # \u6bcf\u624b\u6570\u91cf\n            'name': '\u957f\u548c', # \u80a1\u7968\u540d\u79f0\n            'price': '97.20', # \u80a1\u7968\u5f53\u524d\u4ef7\u683c\n            'lastPrice': '97.75', # \u80a1\u7968\u6628\u5929\u6536\u76d8\u4ef7\u683c\n            'openPrice': '97.75', # \u80a1\u7968\u4eca\u5929\u5f00\u76d8\u4ef7\u683c\n            'amount': '1641463.0', # \u80a1\u7968\u6210\u4ea4\u91cf \n            'time': '2017/11/29 15:38:58', # \u5f53\u524d\u65f6\u95f4\n            'high': '98.05', # \u5f53\u5929\u6700\u9ad8\u4ef7\u683c\n            'low': '97.15' # \u5f53\u5929\u6700\u4f4e\u4ef7\u683c\n        }, \n    '00700': \n        {\n            'stock_code': '00700', \n            'lotSize': '\"100',\n            'name': '\u817e\u8baf\u63a7\u80a1', \n            'price': '413.20', \n            'lastPrice': '419.20', \n            'openPrice': '422.20', \n            'amount': '21351010.0', \n            'time': '2017/11/29 15:39:01', \n            'high': '422.80',\n            'low': '412.40'\n        }\n}\n```\n\n### \u5f00\u53d1\u6307\u5357\n\n#### \u521d\u59cb\u5316\u73af\u5883\n\n\u8fdb\u5165\u9879\u76ee\u76ee\u5f55\u540e\u8fd0\u884c \n\n```\nmake init\n```\n\n\u63d0\u4ea4\u4ee3\u7801\u65f6\u901a\u8fc7\u6240\u6709 `hooks` \u68c0\u67e5\u5373\u53ef",
    "bugtrack_url": null,
    "license": "BSD",
    "summary": "A utility for Fetch China Stock Info",
    "version": "0.7.5",
    "split_keywords": [
        "china",
        "stock",
        "trade"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "fe9245cfc34838666eb08b8119403776",
                "sha256": "d056a1ab27e9608753f4464185ad078693bfd55b9c7a2526f251f8b743242d96"
            },
            "downloads": -1,
            "filename": "easyquotation-0.7.5.tar.gz",
            "has_sig": false,
            "md5_digest": "fe9245cfc34838666eb08b8119403776",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 36907,
            "upload_time": "2022-01-22T12:47:25",
            "upload_time_iso_8601": "2022-01-22T12:47:25.604113Z",
            "url": "https://files.pythonhosted.org/packages/22/84/a4b65e0d01ae93bd1719da50979ebf03b440911d8da16931728d89eedb4d/easyquotation-0.7.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-01-22 12:47:25",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "shidenggui",
    "github_project": "easyquotation",
    "travis_ci": true,
    "coveralls": true,
    "github_actions": false,
    "requirements": [
        {
            "name": "requests",
            "specs": []
        }
    ],
    "lcname": "easyquotation"
}
        
Elapsed time: 0.02311s