使用python分析数据的基于web的仪表板
boardif的Python项目详细描述
登机
使用python分析数据的基于web的仪表板
安装
pip3 install boardify
用法
fromboardifyimportBaseDashboard,BaseBlock,BarChart# Class for the dashboardclassFruitDashboard(BaseDashboard):defconfig(self):self.name="Fruit Company"# Add Blocks to the dashboardself.add_block(Products)self.add_block(NicestFruit)# Block contains HTML CodeclassProducts(BaseBlock):defconfig(self):self.name="Products"self.description="A list of our products"defgenerate(self):return"""<ul> <li>Apple</li> <li>Orange</li> <li>Banana</li> <li>Kiwifruit</li> <li>Blueberry</li> <li>Grapes</li> </ul>"""# Block renders a bar chartclassNicestFruit(BarChart):defconfig(self):self.name="Nicest Fruit"self.description=("A survey of 145 people asked them ""\"Which is the nicest fruit?\"")defdata(self):return{"datasets":{"Survey One":[35,20,45,10,30,5],"Survey Two":[30,25,60,5,35,0],},"labels":["Apple","Orange","Banana","Kiwifruit","Blueberry","Grapes"],"background_color":["rgb(128, 18, 2)","rgb(244, 132, 0)","rgb(246, 221, 0)","rgba(83, 65, 25, 0.97)","rgb(35, 123, 214)","rgb(99, 74, 161)"]}# Run the serverdashboard=FruitDashboard()dashboard.run()
在http://localhost:7000打开仪表板
用
制成元
卢卡斯·希尔德-https://lucas-hild.de
此项目是根据麻省理工学院的许可证授权的-有关详细信息,请参见许可证文件