Example #1
0
import my_tushare as ts
from pandas import Series, DataFrame

# 设置token
token = '3af5b0a6e8922ba964ac5590bd3718503de6c5a9b4fef775e6e32553'
# ts.set_token(token)
pro = ts.pro_api(token)


def get_all_stock_code():
    basic = pro.stock_basic(list_status='L')
    return DataFrame(basic, columns=['ts_code'])
Example #2
0
File: test.py Project: hookex/stock
import my_tushare as ts
import pandas as pd
from pandas import Series, DataFrame

import matplotlib.pyplot as plt

from pylab import mpl
import config

# K线图可视化
from pyecharts import Kline

mpl.rcParams['font.sans-serif'] = ['SimHei']
mpl.rcParams['axes.unicode_minus'] = False

# 设置token

# ts.set_token(token)
pro = ts.pro_api(config.token)

# fd = ts.Macro()
# df = fd.ChinaDataCPI(indicID='M030000003', field='indicName,periodDate,dataValue,dataSource')
# df = df.sort('periodDate', ascending=False)

print(ts.get_deposit_rate())

import K

K.token