1 Star 0 Fork 9

柳叶一刀/股票财务指标数据

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
fiance_indicotor 55.35 KB
一键复制 编辑 原始数据 按行查看 历史
小果量化 提交于 2022-04-26 00:32 . add fiance_indicotor.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001
import pandas as pd
import tkinter
import requests
from bs4 import BeautifulSoup
from lxml import etree
import PySimpleGUI as sg
import matplotlib.pyplot as plt
import akshare as ak
from finta import TA
import mplfinance as mpf
plt.rcParams['font.family']='SimHei'
plt.rcParams['axes.unicode_minus']=False
stock=sg.popup_get_file('输入股票代码比如600031')
root=tkinter.Tk()
root.geometry('600x500')
root.title('新浪财经财务数据获取')
menumode=tkinter.Menu(root)
fiance_mgzy=tkinter.Menu(menumode)
menumode.add_cascade(label='新浪财经财务指标每股指标',menu=fiance_mgzy)
#摊薄每股收益率
def tdggsyl():
df=pd.read_html(r'https://money.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios40'.format(stock))[3].dropna()
df.columns=['时间','摊薄每股收益率','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df['摊薄每股收益率'])
plt.title('股票{}摊薄每股收益率'.format(stock))
plt.show()
#加权每股收益率
def jqmgsyl():
df=pd.read_html(r'https://money.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios61'.format(stock))[3].dropna()
df.columns=['时间','加权每股收益率','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['加权每股收益率'])
plt.title('股票{}加权每股收益率'.format(stock))
plt.show()
#每股收益率
def mgsyl():
df=pd.read_html(r'https://money.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios53'.format(stock))[3].dropna()
df.columns=['时间','每股收益率','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['每股收益率'])
plt.title('股票{}每股收益率'.format(stock))
plt.show()
#扣除非经常性损益后的每股收益(元)
def kcjcsymgsyl():
df=pd.read_html(r'https://money.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios64'.format(stock))[3].dropna()
df.columns=['时间','扣除非经常性损益后的每股收益(元)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['扣除非经常性损益后的每股收益(元)'])
plt.title('股票{}扣除非经常性损益后的每股收益(元)'.format(stock))
plt.show()
#每股净资产_调整前(元)
def bgjzc_tzq():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios85'.format(stock))[3].dropna()
df.columns=['时间','每股净资产_调整前(元)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['每股净资产_调整前(元)'])
plt.title('股票{}每股净资产_调整前(元)'.format(stock))
plt.show()
#每股净资产_调整后(元)
def mgjzc_tzh():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios54'.format(stock))[3].dropna()
df.columns=['时间','每股净资产_调整后(元)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['每股净资产_调整后(元)'])
plt.title('股票{}每股净资产_调整后(元)'.format(stock))
plt.show()
#每股经营性现金流(元)
def mgjyxxjl():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios55'.format(stock))[3].dropna()
df.columns=['时间','每股经营性现金流(元)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['每股经营性现金流(元)'])
plt.title('股票{}每股经营性现金流(元)'.format(stock))
plt.show()
#每股资本公积金(元)
def mgzbgjj():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios63'.format(stock))[3].dropna()
df.columns=['时间','每股资本公积金(元)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['每股资本公积金(元)'])
plt.title('股票{}每股资本公积金(元)'.format(stock))
plt.show()
#每股未分配利润(元)
def mgwfblr():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios66'.format(stock))[3].dropna()
df.columns=['时间','每股未分配利润(元)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['每股未分配利润(元)'])
plt.title('股票{}每股未分配利润(元)'.format(stock))
plt.show()
#调整后的每股净资产(元)
def tzhmgjzc():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios60'.format(stock))[3].dropna()
df.columns=['时间','调整后的每股净资产(元)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['调整后的每股净资产(元)'])
plt.title('股票{}调整后的每股净资产(元)'.format(stock))
plt.show()
fiance_mgzy.add_command(label='摊薄每股收益率',command=tdggsyl)
fiance_mgzy.add_command(label='加权每股收益率',command=jqmgsyl)
fiance_mgzy.add_command(label='调整后每股收益率',command=mgsyl)
fiance_mgzy.add_command(label='扣除非经常性损益后的每股收益(元)',command=kcjcsymgsyl)
fiance_mgzy.add_command(label='每股净资产_调整前(元)',command=bgjzc_tzq)
fiance_mgzy.add_command(label='每股净资产_调整后(元)',command=mgjzc_tzh)
fiance_mgzy.add_command(label='每股经营性现金流(元)',command=mgjyxxjl)
fiance_mgzy.add_command(label='每股资本公积金(元)',command=mgzbgjj)
fiance_mgzy.add_command(label='每股未分配利润(元)',command=mgwfblr)
fiance_mgzy.add_command(label='调整后的每股净资产(元)',command=tzhmgjzc)
fiance_ylnl=tkinter.Menu(menumode)
menumode.add_cascade(label='新浪财经财务指标盈利能力',menu=fiance_ylnl)
#总资产利润率(%)
def zzclrl():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios26'.format(stock))[3].dropna()
df.columns=['时间','总资产利润率(%)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['总资产利润率(%)'])
plt.title('股票{}总资产利润率(%)'.format(stock))
plt.show()
#主营业务利润率(%)
def zyywlrl():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios27'.format(stock))[3].dropna()
df.columns=['时间','主营业务利润率(%)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['主营业务利润率(%)'])
plt.title('股票{}主营业务利润率(%)'.format(stock))
plt.show()
#总资产净利润率(%)
def zzcjlrl():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios28'.format(stock))[3].dropna()
df.columns=['时间','总资产净利润率(%)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['总资产净利润率(%)'])
plt.title('股票{}总资产净利润率(%)'.format(stock))
plt.show()
#成本费用利润率(%)
def cbfylrl():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios29'.format(stock))[3].dropna()
df.columns=['时间','成本费用利润率(%)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['成本费用利润率(%)'])
plt.title('股票{}成本费用利润率(%)'.format(stock))
plt.show()
#营业利润率(%)
def yylrl():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios30'.format(stock))[3].dropna()
df.columns=['时间','营业利润率(%)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['营业利润率(%)'])
plt.title('股票{}营业利润率(%)'.format(stock))
plt.show()
#主营业务成本率(%)
def zyywcbl():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios31'.format(stock))[3].dropna()
df.columns=['时间','主营业务成本率(%)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['主营业务成本率(%)'])
plt.title('股票{}主营业务成本率(%)'.format(stock))
plt.show()
#销售净利率(%)
def xsjll():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios32'.format(stock))[3].dropna()
df.columns=['时间','销售净利率(%)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['销售净利率(%)'])
plt.title('股票{}销售净利率(%)'.format(stock))
plt.show()
#股本报酬率(%)
def gbbcl():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios33'.format(stock))[3].dropna()
df.columns=['时间','股本报酬率(%)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['股本报酬率(%)'])
plt.title('股票{}股本报酬率(%)'.format(stock))
plt.show()
#净资产报酬率(%)
def jzcbcl():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios34'.format(stock))[3].dropna()
df.columns=['时间','净资产报酬率(%)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['净资产报酬率(%)'])
plt.title('股票{}净资产报酬率(%)'.format(stock))
plt.show()
#资产报酬率(%)
def zcbcl():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios35'.format(stock))[3].dropna()
df.columns=['时间','资产报酬率(%)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['资产报酬率(%)'])
plt.title('股票{}资产报酬率(%)'.format(stock))
plt.show()
#销售毛利率(%)
def xsmll():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios36'.format(stock))[3].dropna()
df.columns=['时间','销售毛利率(%)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['销售毛利率(%)'])
plt.title('股票{}销售毛利率(%)'.format(stock))
plt.show()
#三项费用比重
def sxfybz():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios37'.format(stock))[3].dropna()
df.columns=['时间','三项费用比重','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['三项费用比重'])
plt.title('股票{}三项费用比重'.format(stock))
plt.show()
#非主营比重
def fzybz():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios38'.format(stock))[3].dropna()
df.columns=['时间','非主营比重','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['非主营比重'])
plt.title('股票{}非主营比重'.format(stock))
plt.show()
#主营利润比重
def zylrbz():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios39'.format(stock))[3].dropna()
df.columns=['时间','主营利润比重','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['主营利润比重'])
plt.title('股票{}主营利润比重'.format(stock))
plt.show()
#股息发放率(%)
def gxffl():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios41'.format(stock))[3].dropna()
df.columns=['时间','股息发放率(%)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['股息发放率(%)'])
plt.title('股票{}股息发放率(%)'.format(stock))
plt.show()
#投资收益率(%)
def tzsyl():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios42'.format(stock))[3].dropna()
df.columns=['时间','投资收益率(%)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['投资收益率(%)'])
plt.title('股票{}投资收益率(%)'.format(stock))
plt.show()
#主营业务利润(元)
def zyywlr():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios57'.format(stock))[3].dropna()
df.columns=['时间','主营业务利润(元)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['主营业务利润(元)'])
plt.title('股票{}主营业务利润(元)'.format(stock))
plt.show()
#净资产收益率(%)
def jzcsyl():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios59'.format(stock))[3].dropna()
df.columns=['时间','净资产收益率(%)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['净资产收益率(%)'])
plt.title('股票{}净资产收益率(%)'.format(stock))
plt.show()
#加权净资产收益率(%)
def jqjzcsyl():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios62'.format(stock))[3].dropna()
df.columns=['时间','加权净资产收益率(%)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['加权净资产收益率(%)'])
plt.title('股票{}加权净资产收益率(%)'.format(stock))
plt.show()
#扣除非经常性损益后的净利润(元)
def kcfjcxsyjlr():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios65'.format(stock))[3].dropna()
df.columns=['时间','扣除非经常性损益后的净利润(元)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['扣除非经常性损益后的净利润(元)'])
plt.title('股票{}扣除非经常性损益后的净利润(元)'.format(stock))
plt.show()
fiance_ylnl.add_command(label='总资产利润率(%)',command=zzclrl)
fiance_ylnl.add_command(label='主营业务利润率(%)',command=zyywlrl)
fiance_ylnl.add_command(label='总资产净利润率(%)',command=zzcjlrl)
fiance_ylnl.add_command(label='成本费用利润率(%)',command=cbfylrl)
fiance_ylnl.add_command(label='营业利润率(%)',command=yylrl)
fiance_ylnl.add_command(label='主营业务成本率(%)',command=zyywcbl)
fiance_ylnl.add_command(label='销售净利率(%)',command=xsjll)
fiance_ylnl.add_command(label='股本报酬率(%)',command=gbbcl)
fiance_ylnl.add_command(label='净资产报酬率(%)',command=jzcbcl)
fiance_ylnl.add_command(label='资产报酬率(%)',command=zcbcl)
fiance_ylnl.add_command(label='销售毛利率(%)',command=xsmll)
fiance_ylnl.add_command(label='三项费用比重',command=sxfybz)
fiance_ylnl.add_command(label='非主营比重',command=fzybz)
fiance_ylnl.add_command(label='主营利润比重',command=zylrbz)
fiance_ylnl.add_command(label='股息发放率(%)',command=gxffl)
fiance_ylnl.add_command(label='投资收益率(%)',command=tzsyl)
fiance_ylnl.add_command(label='主营业务利润(元)',command=zyywlr)
fiance_ylnl.add_command(label='净资产收益率(%)',command=jzcsyl)
fiance_ylnl.add_command(label='加权净资产收益率(%)',command=jqjzcsyl)
fiance_ylnl.add_command(label='扣除非经常性损益后的净利润(元',command=kcfjcxsyjlr)
fiance_cznl=tkinter.Menu(menumode)
menumode.add_cascade(label='新浪财经财务指标成长能力',men=fiance_cznl)
#主营业务收入增长率(%)
def zyywsrzzl():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios43'.format(stock))[3].dropna()
df.columns=['时间','主营业务收入增长率(%)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['主营业务收入增长率(%)'])
plt.title('股票{}主营业务收入增长率(%)'.format(stock))
plt.show()
#净利润增长率(%)
def jlrzzl():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios44'.format(stock))[3].dropna()
df.columns=['时间','净利润增长率(%)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['净利润增长率(%)'])
plt.title('股票{}净利润增长率(%)'.format(stock))
plt.show()
#净资产增长率(%)
def jzczzl():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios45'.format(stock))[3].dropna()
df.columns=['时间','净资产增长率(%)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['净资产增长率(%)'])
plt.title('股票{}净资产增长率(%)'.format(stock))
plt.show()
#总资产增长率(%)
def zzczzl():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios45'.format(stock))[3].dropna()
df.columns=['时间','总资产增长率(%)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['总资产增长率(%)'])
plt.title('股票{}总资产增长率(%)'.format(stock))
plt.show()
fiance_cznl.add_command(label='主营业务收入增长率(%)',command=zyywsrzzl)
fiance_cznl.add_command(label='净利润增长率(%)',command=jlrzzl)
fiance_cznl.add_command(label='净资产增长率(%)',command=jzczzl)
fiance_cznl.add_command(label='总资产增长率(%)',command=zzczzl)
#营运能力
fiance_yynl=tkinter.Menu(menumode)
menumode.add_cascade(label='新浪财经财务指标营运能力',menu=fiance_yynl)
#应收账款周转率(次)
def yszkzzl():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios3'.format(stock))[3].dropna()
df.columns=['时间','应收账款周转率(次)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['应收账款周转率(次)'])
plt.title('股票{}应收账款周转率(次)'.format(stock))
plt.show()
#应收账款周转天数(天)
def yszkzzts():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios4'.format(stock))[3].dropna()
df.columns=['时间','应收账款周转天数(天)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['应收账款周转天数(天)'])
plt.title('股票{}应收账款周转天数(天)'.format(stock))
plt.show()
#存货周转天数(天)
def ckzzts():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios22'.format(stock))[3].dropna()
df.columns=['时间','存货周转天数(天)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['存货周转天数(天)'])
plt.title('股票{}存货周转天数(天)'.format(stock))
plt.show()
#存货周转率(次)
def chzzl():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios19'.format(stock))[3].dropna()
df.columns=['时间','存货周转率(次)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['存货周转率(次)'])
plt.title('股票{}存货周转率(次)'.format(stock))
plt.show()
#固定资产周转率(次)
def gdzczzl():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios20'.format(stock))[3].dropna()
df.columns=['时间','固定资产周转率(次)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['固定资产周转率(次)'])
plt.title('股票{}固定资产周转率(次)'.format(stock))
plt.show()
#总资产周转率(次)
def zzczzl():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios21'.format(stock))[3].dropna()
df.columns=['时间','总资产周转率(次)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['总资产周转率(次)'])
plt.title('股票{}总资产周转率(次)'.format(stock))
plt.show()
#总资产周转天数(天)
def zzczzts():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios23'.format(stock))[3].dropna()
df.columns=['时间','总资产周转天数(天)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['总资产周转天数(天)'])
plt.title('股票{}总资产周转天数(天)'.format(stock))
plt.show()
#流动资产周转率(次)
def ldzczzl():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios24'.format(stock))[3].dropna()
df.columns=['时间','流动资产周转率(次)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['流动资产周转率(次)'])
plt.title('股票{}流动资产周转率(次)'.format(stock))
plt.show()
#流动资产周转天数(天)
def ldzczzts():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios25'.format(stock))[3].dropna()
df.columns=['时间','流动资产周转天数(天)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['流动资产周转天数(天)'])
plt.title('股票{}流动资产周转天数(天)'.format(stock))
plt.show()
#股东权益周转率(次)
def gdqyzzl():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios52'.format(stock))[3].dropna()
df.columns=['时间','股东权益周转率(次)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['股东权益周转率(次)'])
plt.title('股票{}股东权益周转率(次)'.format(stock))
plt.show()
fiance_yynl.add_command(label='应收账款周转率(次)',command=yszkzzl)
fiance_yynl.add_command(label='应收账款周转天数(天)',command=yszkzzts)
fiance_yynl.add_command(label='存货周转天数(天)',command=ckzzts)
fiance_yynl.add_command(label='存货周转率(次)',command=chzzl)
fiance_yynl.add_command(label='固定资产周转率(次)',command=gdzczzl)
fiance_yynl.add_command(label='总资产周转率(次)',command=zzczzl)
fiance_yynl.add_command(label='总资产周转天数(天)',command=zzczzts)
fiance_yynl.add_command(label='流动资产周转率(次)',command=ldzczzl)
fiance_yynl.add_command(label='流动资产周转天数(天)',command=ldzczzts)
fiance_yynl.add_command(label='股东权益周转率(次)',command=gdqyzzl)
#偿债能力和股本结构
fiance_gbjg=tkinter.Menu(menumode)
menumode.add_cascade(label='新浪财经财务指标偿债能力和股本结构',menu=fiance_gbjg)
#流动比率
def ldbl():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios1'.format(stock))[3].dropna()
df.columns=['时间','流动比率','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['流动比率'])
plt.title('股票{}流动比率'.format(stock))
plt.show()
#速动比率
def sdbl():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios2'.format(stock))[3].dropna()
df.columns=['时间','速动比率','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['速动比率'])
plt.title('股票{}速动比率'.format(stock))
plt.show()
#现金比率(%)
def xjbl():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios5'.format(stock))[3].dropna()
df.columns=['时间','现金比率(%)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['现金比率(%)'])
plt.title('股票{}现金比率(%)'.format(stock))
plt.show()
#利息支付倍数
def gxzfbs():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios6'.format(stock))[3].dropna()
df.columns=['时间','利息支付倍数','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['利息支付倍数'])
plt.title('股票{}利息支付倍数'.format(stock))
plt.show()
#长期债务与营运资金比率(%)
def cqzwyyyzjbl():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios7'.format(stock))[3].dropna()
df.columns=['时间','长期债务与营运资金比率(%)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['长期债务与营运资金比率(%)'])
plt.title('股票{}长期债务与营运资金比率(%)'.format(stock))
plt.show()
#股东权益比率(%)
def gdqybl():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios8'.format(stock))[3].dropna()
df.columns=['时间','股东权益比率(%)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['股东权益比率(%)'])
plt.title('股票{}股东权益比率(%)'.format(stock))
plt.show()
#长期负债比率(%)
def cqfzbl():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios8'.format(stock))[3].dropna()
df.columns=['时间','股东权益比率(%)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['股东权益比率(%)'])
plt.title('股票{}股东权益比率(%)'.format(stock))
plt.show()
#股东权益与固定资产比率(%)
def gdqyygdzcbl():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios10'.format(stock))[3].dropna()
df.columns=['时间','股东权益与固定资产比率(%)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['股东权益与固定资产比率(%)'])
plt.title('股票{}股东权益与固定资产比率(%)'.format(stock))
plt.show()
#负债与所有者权益比率(%)
def fzysyzqybl():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios11'.format(stock))[3].dropna()
df.columns=['时间','负债与所有者权益比率(%)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['负债与所有者权益比率(%)'])
plt.title('股票{}负债与所有者权益比率(%)'.format(stock))
plt.show()
#长期资产与长期资金比率(%)
def cqzcycqzjbl():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios12'.format(stock))[3].dropna()
df.columns=['时间','长期资产与长期资金比率(%)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['长期资产与长期资金比率(%)'])
plt.title('股票{}长期资产与长期资金比率(%)'.format(stock))
plt.show()
#资本化比率(%)
def zbhbl():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios13'.format(stock))[3].dropna()
df.columns=['时间','资本化比率(%)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['资本化比率(%)'])
plt.title('股票{}资本化比率(%)'.format(stock))
plt.show()
#固定资产净值率(%)
def gdzcjzl():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios14'.format(stock))[3].dropna()
df.columns=['时间','固定资产净值率(%)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['固定资产净值率(%)'])
plt.title('股票{}固定资产净值率(%)'.format(stock))
plt.show()
#资本固定化比率(%)
def zcgdhbl():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios15'.format(stock))[3].dropna()
df.columns=['时间','资本固定化比率(%)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['资本固定化比率(%)'])
plt.title('股票{}资本固定化比率(%)'.format(stock))
plt.show()
#产权比率(%)
def cqbl():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios16'.format(stock))[3].dropna()
df.columns=['时间','产权比率(%)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['产权比率(%)'])
plt.title('股票{}产权比率(%)'.format(stock))
plt.show()
#清算价值比率(%)
def qsjzbl():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios17'.format(stock))[3].dropna()
df.columns=['时间','清算价值比率(%)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['清算价值比率(%)'])
plt.title('股票{}清算价值比率(%)'.format(stock))
plt.show()
#固定资产比重(%)
def gdzcbz():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios18'.format(stock))[3].dropna()
df.columns=['时间','固定资产比重(%)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['固定资产比重(%)'])
plt.title('股票{}固定资产比重(%)'.format(stock))
plt.show()
#资产负债率(%)
def zcfzl():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios56'.format(stock))[3].dropna()
df.columns=['时间','资产负债率(%)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['资产负债率(%)'])
plt.title('股票{}资产负债率(%)'.format(stock))
plt.show()
#总资产(元)
def zzc():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios58'.format(stock))[3].dropna()
df.columns=['时间','总资产(元)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['总资产(元)'])
plt.title('股票{}总资产(元)'.format(stock))
plt.show()
fiance_gbjg.add_command(label='流动比率',command=ldbl)
fiance_gbjg.add_command(label='流动比率',command=sdbl)
fiance_gbjg.add_command(label='现金比率(%)',command=xjbl)
fiance_gbjg.add_command(label='利息支付倍数',command=gxzfbs)
fiance_gbjg.add_command(label='长期债务与营运资金比率(%)',command=cqzwyyyzjbl)
fiance_gbjg.add_command(label='股东权益比率(%)',command=gdqybl)
fiance_gbjg.add_command(label='长期负债比率(%)',command=cqfzbl)
fiance_gbjg.add_command(label='股东权益与固定资产比率(%)',command=gdqyygdzcbl)
fiance_gbjg.add_command(label='负债与所有者权益比率(%)',command=fzysyzqybl)
fiance_gbjg.add_command(label='长期资产与长期资金比率(%)',command=cqzcycqzjbl)
fiance_gbjg.add_command(label='资本化比率(%)',command=zbhbl)
fiance_gbjg.add_command(label='固定资产净值率(%)',command=gdzcjzl)
fiance_gbjg.add_command(label='资本固定化比率(%)',command=zcgdhbl)
fiance_gbjg.add_command(label='产权比率(%)',command=cqbl)
fiance_gbjg.add_command(label='清算价值比率(%)',command=qsjzbl)
fiance_gbjg.add_command(label='固定资产比重(%)',command=gdzcbz)
fiance_gbjg.add_command(label='资产负债率(%)',command=zcfzl)
fiance_gbjg.add_command(label='总资产(元)',command=zzc)
#现金流量
fiance_xjnl=tkinter.Menu(menumode)
menumode.add_cascade(label='新浪财经财务指标现金流量',menu=fiance_xjnl)
#经营现金净流量对销售收入比率(%)
def jyxjjlldxssr():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios47'.format(stock))[3].dropna()
df.columns=['时间','经营现金净流量对销售收入比率(%)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['经营现金净流量对销售收入比率(%)'])
plt.title('股票{}经营现金净流量对销售收入比率(%)'.format(stock))
plt.show()
#资产的经营现金流量回报率(%)
def zcdjyxljhbl():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios48'.format(stock))[3].dropna()
df.columns=['时间','资产的经营现金流量回报率(%)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['资产的经营现金流量回报率(%)'])
plt.title('股票{}资产的经营现金流量回报率(%)'.format(stock))
plt.show()
#经营现金净流量与净利润的比率(%)
def jyxjjllylrbl():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios49'.format(stock))[3].dropna()
df.columns=['时间','经营现金净流量与净利润的比率(%)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['经营现金净流量与净利润的比率(%)'])
plt.title('股票{}经营现金净流量与净利润的比率(%)'.format(stock))
plt.show()
#经营现金净流量对负债比率(%)
def jyxjlldfzbl():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios50'.format(stock))[3].dropna()
df.columns=['时间','经营现金净流量对负债比率(%)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['经营现金净流量对负债比率(%)'])
plt.title('股票{}经营现金净流量对负债比率(%)'.format(stock))
plt.show()
#现金流量比率(%)
def xjllbl():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios51'.format(stock))[3].dropna()
df.columns=['时间','现金流量比率(%)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['现金流量比率(%)'])
plt.title('股票{}现金流量比率(%)'.format(stock))
plt.show()
fiance_xjnl.add_command(label='经营现金净流量对销售收入比率(%)',command=jyxjjlldxssr)
fiance_xjnl.add_command(label='资产的经营现金流量回报率(%)',command=zcdjyxljhbl)
fiance_xjnl.add_command(label='经营现金净流量与净利润的比率(%)',command=jyxjjllylrbl)
fiance_xjnl.add_command(label='经营现金净流量对负债比率(%)',command=jyxjlldfzbl)
fiance_xjnl.add_command(label='现金流量比率(%)',command=xjllbl)
#其他财务指标
fiance_qtzb=tkinter.Menu(menumode)
menumode.add_cascade(label='新浪财经财务指标其他财务指标',menu=fiance_qtzb)
#短期股票投资(元)
def dqgutz():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios67'.format(stock))[3].dropna()
df.columns=['时间','短期股票投资(元)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['短期股票投资(元)'])
plt.title('股票{}短期股票投资(元)'.format(stock))
plt.show()
#短期债券投资(元)
def dqzztz():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid=600031&typecode=financialratios68'.format(stock))[3].dropna()
df.columns=['时间','短期债券投资(元)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['短期债券投资(元)'])
plt.title('股票{}短期债券投资(元)'.format(stock))
plt.show()
#短期其它经营性投资(元)
def dqqtjyxtz():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios69'.format(stock))[3].dropna()
df.columns=['时间','短期其它经营性投资(元)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['短期其它经营性投资(元)'])
plt.title('股票{}短期其它经营性投资(元)'.format(stock))
plt.show()
#长期股票投资(元)
def cqgptz():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios70'.format(stock))[3].dropna()
df.columns=['时间','长期股票投资(元)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['长期股票投资(元)'])
plt.title('股票{}长期股票投资(元)'.format(stock))
plt.show()
#长期债券投资(元)
def cqzztz():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios71'.format(stock))[3].dropna()
df.columns=['时间','长期债券投资(元)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['长期债券投资(元)'])
plt.title('股票{}长期债券投资(元)'.format(stock))
plt.show()
#长期其它经营性投资(元)
def cqqtjyxtz():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios72'.format(stock))[3].dropna()
df.columns=['时间','长期其它经营性投资(元)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['长期其它经营性投资(元)'])
plt.title('股票{}长期其它经营性投资(元)'.format(stock))
plt.show()
#1年以内应收帐款(元)
def yszk():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios73'.format(stock))[3].dropna()
df.columns=['时间','1年以内应收帐款(元)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['1年以内应收帐款(元)'])
plt.title('股票{}1年以内应收帐款(元)'.format(stock))
plt.show()
#1-2年以内应收帐款(元)
def yszk_1_2():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios74'.format(stock))[3].dropna()
df.columns=['时间','1-2年以内应收帐款(元)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['1-2年以内应收帐款(元)'])
plt.title('股票{}1-2年以内应收帐款(元)'.format(stock))
plt.show()
#2-3年以内应收帐款(元)
def yszk_2_3():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios75'.format(stock))[3].dropna()
df.columns=['时间','2-3年以内应收帐款(元)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['2-3年以内应收帐款(元)'])
plt.title('股票{}2-3年以内应收帐款(元)'.format(stock))
plt.show()
#3年以内应收帐款(元)
def yszk_3():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios76'.format(stock))[3].dropna()
df.columns=['时间','3年以内应收帐款(元)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['3年以内应收帐款(元)'])
plt.title('股票{}3年以内应收帐款(元)'.format(stock))
plt.show()
#1年以内预付货款(元)
def yfdk_1():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios77'.format(stock))[3].dropna()
df.columns=['时间','1年以内预付货款(元)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['1年以内预付货款(元)'])
plt.title('股票{}1年以内预付货款(元)'.format(stock))
plt.show()
#1-2年以内预付货款(元)
def yfdk_1_2():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios78'.format(stock))[3].dropna()
df.columns=['时间','1-2年以内预付货款(元)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['1-2年以内预付货款(元)'])
plt.title('股票{}1-2年以内预付货款(元)'.format(stock))
plt.show()
#2-3年以内预付货款(元)
def yfdk_2_3():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios79'.format(stock))[3].dropna()
df.columns=['时间','2-3年以内预付货款(元)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['2-3年以内预付货款(元)'])
plt.title('股票{}2-3年以内预付货款(元)'.format(stock))
plt.show()
#3年以内预付货款(元)
def yfdk_3():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios80'.format(stock))[3].dropna()
df.columns=['时间','3年以内预付货款(元)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['3年以内预付货款(元)'])
plt.title('股票{}3年以内预付货款(元)'.format(stock))
plt.show()
#1年以内其它应收款(元)
def qtysk():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios81'.format(stock))[3].dropna()
df.columns=['时间','1年以内其它应收款(元)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['1年以内其它应收款(元)'])
plt.title('股票{}1年以内其它应收款(元)'.format(stock))
plt.show()
#1-2年以内其它应收款(元)
def qtsyk_1_2():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios81'.format(stock))[3].dropna()
df.columns=['时间','1-2年以内其它应收款(元)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['1-2年以内其它应收款(元)'])
plt.title('股票{}1-2年以内其它应收款(元)'.format(stock))
plt.show()
#2-3年以内其它应收款(元)
def qtysk_2_3():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios83'.format(stock))[3].dropna()
df.columns=['时间','2-3年以内其它应收款(元)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['2-3年以内其它应收款(元)'])
plt.title('股票{}2-3年以内其它应收款(元)'.format(stock))
plt.show()
#3年以内其它应收款(元)
def qtysk_3():
df=pd.read_html(r'https://vip.stock.finance.sina.com.cn/corp/view/vFD_FinancialGuideLineHistory.php?stockid={}&typecode=financialratios83'.format(stock))[3].dropna()
df.columns=['时间','3年以内其它应收款(元)','变动比例']
df1=df.sort_index(ascending=False)
print(df1)
df1.to_excel(r'C:\Users\Administrator\Desktop\财务指标.xlsx')
plt.plot(df1['时间'],df1['3年以内其它应收款(元)'])
plt.title('股票{}3年以内其它应收款(元)'.format(stock))
plt.show()
fiance_qtzb.add_command(label='短期股票投资(元)',command=dqgutz)
fiance_qtzb.add_command(label='短期债券投资(元)',command=dqzztz)
fiance_qtzb.add_command(label='短期其它经营性投资(元)',command=dqqtjyxtz)
fiance_qtzb.add_command(label='长期股票投资(元)',command=cqgptz)
fiance_qtzb.add_command(label='长期债券投资(元)',command=cqzztz)
fiance_qtzb.add_command(label='长期其它经营性投资(元)',command=cqqtjyxtz)
fiance_qtzb.add_command(label='1年以内应收帐款(元)',command=yszk)
fiance_qtzb.add_command(label='1-2年以内应收帐款(元)',command=yszk_1_2)
fiance_qtzb.add_command(label='2-3年以内应收帐款(元)',command=yszk_2_3)
fiance_qtzb.add_command(label='3年以内应收帐款(元)',command=yszk_3)
fiance_qtzb.add_command(label='1年以内预付货款(元)',command=yfdk_1)
fiance_qtzb.add_command(label='1-2年以内预付货款(元)',command=yfdk_1_2)
fiance_qtzb.add_command(label='2-3年以内预付货款(元)',command=yfdk_2_3)
fiance_qtzb.add_command(label='3年以内预付货款(元)',command=yfdk_3)
fiance_qtzb.add_command(label='1年以内其它应收款(元)',command=qtysk)
fiance_qtzb.add_command(label='1-2年以内其它应收款(元)',command=qtsyk_1_2)
fiance_qtzb.add_command(label='2-3年以内其它应收款(元)',command=qtysk_2_3)
fiance_qtzb.add_command(label='3年以内其它应收款(元)',command=qtysk_3)
fiance_K_plot=tkinter.Menu(menumode)
menumode.add_cascade(label='绘制股票图',menu=fiance_K_plot)
def plot_k():
if stock[0]=='6':
stock='sh'+stock
else:
stock='sz'+stock
df1=ak.stock_zh_a_daily(symbol=stock,start_date='20210101')
macd=TA.MACD(df1)
boll=TA.BBANDS(df1)
rsi=TA.RSI(df1)
df1.rename(columns={'date':'Date','open':'Open','close':'Close','high':'High','low':'Low','volume':'Volume'},inplace=True)
#时间格式转换
plt.rcParams['font.family']='SimHei'
plt.rcParams['axes.unicode_minus']=False
df1['Date']=pd.to_datetime(df1['Date'])
#出现设置索引
df1.set_index(['Date'],inplace=True)
#设置股票颜
mc=mpf.make_marketcolors(up='g',down='r',edge='i')
#设置系统
s=mpf.make_mpf_style(marketcolors=mc)
add_plot=[mpf.make_addplot(macd['MACD'],panel=1,title='{}MACD'.format(code),color='r'),mpf.make_addplot(macd['SIGNAL'],panel=1,color='y'),
mpf.make_addplot(rsi,panel=2,title='RSI'),
mpf.make_addplot(boll['BB_UPPER'],panel=0,color='r',title='BOLL'),mpf.make_addplot(boll['BB_MIDDLE'],panel=0,color='m'),mpf.make_addplot(boll['BB_LOWER'],panel=0,color='g')]
#绘制股票图,5,10,20日均线
mpf.plot(df1,type='candle',style=s,mav=(5,10,20),addplot=add_plot)
plt.show()
fiance_K_plot.add_command(label='绘制股票图',command=plot_k)
root['menu']=menumode
root.mainloop()
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/pxw_admin/stock-financial-index-data.git
[email protected]:pxw_admin/stock-financial-index-data.git
pxw_admin
stock-financial-index-data
股票财务指标数据
master

搜索帮助