Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

可以增加设置数据源的配置吗 #14

Closed
royburns opened this issue Nov 30, 2017 · 5 comments
Closed

可以增加设置数据源的配置吗 #14

royburns opened this issue Nov 30, 2017 · 5 comments

Comments

@royburns
Copy link

我记得tushare有多种数据源,有实时拉取,也有缓存到本地的,sqlite或者mongodb之类的

@Seedarchangel
Copy link
Owner

Seedarchangel commented Nov 30, 2017

没有增加是怕变得臃肿。我不记得Tushare自己有sqlite/mongodb配置?
参考http://tushare.org/storing.html
好像没有看到类似的配置

@royburns
Copy link
Author

royburns commented Dec 2, 2017

截图上传失败,nosql就是,往下翻就能看到,

@royburns
Copy link
Author

royburns commented Dec 2, 2017

不过确实不是tushare直接提供的

MongoDB
pandas目前没有提供直接存入MongoDB的方法,不过依然很简单,而且方式很多,用户可根据自身的业务特点选择存储的结构方式。

使用方法:

import pymongo
import json

conn = pymongo.Connection('127.0.0.1', port=27017)
df = ts.get_tick_data('600848',date='2014-12-22')

conn.db.tickdata.insert(json.loads(df.to_json(orient='records')))

@royburns
Copy link
Author

royburns commented Dec 2, 2017

用mysql也可以,有个数据存存起来感觉更好点,哈哈哈

@Seedarchangel
Copy link
Owner

@royburns 确实可以考虑一下,目前没加还是因为dependency太复杂会增加使用难度

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants