Skip to content

Commit

Permalink
0.6.7
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmysoa committed Dec 27, 2016
1 parent 3424473 commit d6c4a37
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tushare/__init__.py
@@ -1,4 +1,4 @@
__version__ = '0.6.5'
__version__ = '0.6.7'
__author__ = 'Jimmy Liu'
"""
for trading data
Expand Down
2 changes: 1 addition & 1 deletion tushare/stock/ref_vars.py
Expand Up @@ -34,7 +34,7 @@
QUARTS_DIC = {'1':('%s-12-31', '%s-03-31'), '2':('%s-03-31', '%s-06-30'),
'3':('%s-06-30', '%s-09-30'), '4':('%s-9-30', '%s-12-31')}
FUND_HOLDS_COLS = ['count', 'clast', 'date', 'ratio', 'amount', 'nums','nlast', 'name', 'code']
NEW_STOCKS_COLS = ['code', 'name', 'ipo_date', 'issue_date', 'amount', 'markets', 'price', 'pe',
NEW_STOCKS_COLS = ['code', 'xcode', 'name', 'ipo_date', 'issue_date', 'amount', 'markets', 'price', 'pe',
'limit', 'funds', 'ballot']
MAR_SH_COOKIESTR = '_gscu_1808689395=27850607moztu036'
MAR_SH_HZ_COLS = ['opDate', 'rzye', 'rzmre', 'rqyl', 'rqylje', 'rqmcl', 'rzrqjyzl']
Expand Down
4 changes: 3 additions & 1 deletion tushare/stock/reference.py
Expand Up @@ -353,6 +353,7 @@ def new_stocks(retry_count=3, pause=0.001):
------
DataFrame
code:股票代码
xcode:申购代码
name:名称
ipo_date:上网发行日期
issue_date:上市日期
Expand Down Expand Up @@ -387,9 +388,10 @@ def _newstocks(data, pageNo, retry_count, pause):
sarr = sarr.replace('<font color="red">*</font>', '')
sarr = '<table>%s</table>'%sarr
df = pd.read_html(StringIO(sarr), skiprows=[0, 1])[0]
df = df.drop([df.columns[idx] for idx in [1, 12, 13, 14]], axis=1)
df = df.drop([df.columns[idx] for idx in [12, 13, 14]], axis=1)
df.columns = rv.NEW_STOCKS_COLS
df['code'] = df['code'].map(lambda x : str(x).zfill(6))
df['xcode'] = df['xcode'].map(lambda x : str(x).zfill(6))
res = html.xpath('//table[@class=\"table2\"]/tr[1]/td[1]/a/text()')
tag = '下一页' if ct.PY3 else unicode('下一页', 'utf-8')
hasNext = True if tag in res else False
Expand Down
4 changes: 2 additions & 2 deletions tushare/stock/trading.py
Expand Up @@ -18,6 +18,7 @@
import re
from pandas.compat import StringIO
from tushare.util import dateu as du
from tushare.stock.reference import new_stocks
try:
from urllib.request import urlopen, Request
except ImportError:
Expand Down Expand Up @@ -650,12 +651,11 @@ def get_k_data(code=None, start='', end='',
urls = []
for year in years:
startdate = str(year) + '-01-01'
enddate = str(year+1) + '-12-30'
enddate = str(year+1) + '-12-31'
url = ct.KLINE_TT_URL%(ct.P_TYPE['http'], ct.DOMAINS['tt'],
kline, fq+str(year), symbol,
ct.TT_K_TYPE[ktype.upper()], startdate, enddate,
fq, _random(17))
print(url)
urls.append(url)
dataflag = '%s%s'%(fq, ct.TT_K_TYPE[ktype.upper()])
elif ktype in ct.K_MIN_LABELS:
Expand Down

0 comments on commit d6c4a37

Please sign in to comment.