forked from Rockyzsu/stock
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmarket_basic.py
More file actions
34 lines (26 loc) · 752 Bytes
/
market_basic.py
File metadata and controls
34 lines (26 loc) · 752 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# -*-coding=utf-8-*-
__author__ = 'Rocky'
'''
http://30daydo.com
Contact: weigesysu@qq.com
股市基本面
'''
from setting import get_engine
import tushare as ts
engine = get_engine('db_finance_report')
def year_report(year):
df0 = ts.get_report_data(year, 4)
df0.to_sql(str(year)+'_main',engine)
df1 = ts.get_profit_data(year, 4)
df1.to_sql(str(year)+'_profit',engine)
df2 = ts.get_growth_data(year, 4)
df2.to_sql(str(year)+'_growth',engine)
df3 = ts.get_debtpaying_data(year, 4)
df3.to_sql(str(year)+'_debtpaying',engine)
df4 = ts.get_cashflow_data(year, 4)
df4.to_sql(str(year)+'_cashflow',engine)
def main():
for i in range(2010,2018):
year_report(i)
if __name__=='__main__':
main()