Skip to content

Commit

Permalink
feat(jsl): add fundm func
Browse files Browse the repository at this point in the history
  • Loading branch information
shidenggui committed Mar 27, 2016
1 parent 90370df commit 92b7587
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions easyquotation/jsl.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ class Jsl(object):
# 分级B的接口
__fundb_url = 'http://www.jisilu.cn/data/sfnew/fundb_list/?___t={ctime:d}'

# 母基接口
__fundm_url = 'https://www.jisilu.cn/data/sfnew/fundm_list/?___t={ctime:d}'

# 分级套利的接口
__fundarb_url = 'http://www.jisilu.cn/data/sfnew/arbitrage_vip_list/?___t={ctime:d}'

Expand Down Expand Up @@ -142,6 +145,20 @@ def funda(self, fields=[], min_volume=0, min_discount=0, ignore_nodown=False, fo
self.__funda = data
return self.__funda

def fundm(self):
"""以字典形式返回分级母基数据
"""
# 添加当前的ctime
self.__fundm_url = self.__fundm_url.format(ctime=int(time.time()))
# 请求数据
rep = requests.get(self.__fundm_url)
# 获取返回的json字符串
fundmjson = json.loads(rep.text)
# 格式化返回的json字符串
data = self.formatfundajson(fundmjson)
self.__fundm = data
return self.__fundm

def fundb(self, fields=[], min_volume=0, min_discount=0, forever=False):
"""以字典形式返回分级B数据
:param fields:利率范围,形如['+3.0%', '6.0%']
Expand Down

0 comments on commit 92b7587

Please sign in to comment.