datacenter_datasdk
Project description
datacenter_datasdk
INSTALL
step.1
pip install datacenter-datasdk
step.2 add auth(token, password) (ask for admin) before query data
USAGE
from datacenter_datasdk import auth, get_price, get_trade_days, get_security_info
auth(token, password)
data = get_price('600033.XSHG', 'cn', 'm1', start_date='2010-01-01', end_date='2021-01-01')
trade_days = get_trade_days('cn', start_date='2021-01-01', count=10)
info = get_security_info('cn', '600033.XSHG')
API
get_price()
get kline data, include daily, minute and tick
params
code(required): str or list, single code or multi code as list
region(required): str, 'cn' or 'us'
frequency(required): str, represent frequency of kline, 'd1', 'm1', 'm5', 'm15', 'm30', 'm60' and 'tick'(only in cn), 'd1_post'(only in cn), 'd1_raw'(only in cn)
start_date(optional), datetime.datetime or datetime.date or str, start time of data, default '2005-01-01'
end_date(optional), datetime.datetime or datetime.date or str, end time of data, default 0 o'clock of today
return
dataframe
get_trade_days()
get trade days
params
region(required): str, 'cn' or 'us'
start_date(optional), datetime.datetime or datetime.date or str, start time of data, default None
end_date(optional), datetime.datetime or datetime.date or str, end time of data, default None
count(optional), int, default None
return
list of date
get_security_info()
get security info
params
region(required): str, 'cn' or 'us'
types(optional): list, values in ('etf', 'stock', 'index'), default ['etf', 'stock', 'index']
code(optional): str, default None (get all code info), default None
date(optional), datetime.datetime or datetime.date or str, not exit market until this date, default None
return
dataframe
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for datacenter_datasdk-0.2.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6711a2c532c1eb3dbb34f0a358f4ddd4389d3a13e4f13d8cf76f2ff5c15fd227 |
|
MD5 | b76ce7cba9015a5238ab6eea45316ab0 |
|
BLAKE2b-256 | 330a3875a4d19e1dc5c2c212bf1f7a63bd44461c5f4f7567bc27412c19d934c8 |