一个独立的、轻量级的web服务器,用于在ipython中创建、共享图形。让ipython做它关注的事情,让它做每个人构建交互式、协作和实时流媒体仪表板所需要的事情。
IPython-Dashboard的Python项目详细描述
*灵感来源于“ipython<;http://ipython.org/>;``用爱建造*
IPython仪表板
一个独立的、轻量级的web服务器,用于构建、共享图形 在ipython中创建。为数据科学和数据分析人员构建。瞄准 在构建交互式可视化、协作仪表板和 实时流图。
用法
安装先决条件
- 安装最新的Stable IPython仪表板: pip install ipython-dashboard--upgrade
- 安装redis 2.6+:install guide
- [option,如果需要运行sql]安装mysql: brew install mysql或apt-get install mysql
- 安装IPython仪表板要求[有时不需要]:
- cd ~/your python package path/IPython-Dashboard
- pip install -r requirements.txt
[`` option``,如果需要运行sql]config mysql
启动mysql服务器:mysql.server start
使用根目录登录mysql:mysql -u root
创建用户并授予特权;
查看当前数据库用户
mysql> SELECT User,Host FROM mysql.user; +------+-----------+ | User | Host | +------+-----------+ | root | 127.0.0.1 | | root | ::1 | | | localhost | | root | localhost | | | mac007 | | root | mac007 | +------+-----------+ 6 rows in set (0.00 sec)
为IPython Dashboard创建用户
mysql> create user 'ipd'@'localhost' identified by 'thanks'; Query OK, 0 rows affected (0.00 sec) mysql> grant all privileges on *.* to ipd@localhost; Query OK, 0 rows affected (0.00 sec) mysql> SELECT User,Host FROM mysql.user; +------+-----------+ | User | Host | +------+-----------+ | root | 127.0.0.1 | | root | ::1 | | | localhost | | ipd | localhost | | root | localhost | | | mac007 | | root | mac007 | +------+-----------+ 7 rows in set (0.00 sec) mysql> flush privileges; Query OK, 0 rows affected (0.00 sec)
创建表格;
nosetests -s dashboard.tests.testCreateData:test_create_mysql_data
创建日志路径
创建存储日志文件的文件夹。我把它放在^{tt9}下面$ 目前:/mnt/ipython-dashboard/logs
使用chmod和 ls -l确认。
chenshan@mac007:/mnt/ipython-dashboard$ls -l total 0 drwxrwxrwx 9 root wheel 306 Dec 15 22:09 logs
config ipython仪表板服务器: `` ipython dashboard/dashboard/config.py``
- app_host='ip_address:port'
启动redis和ipython仪表板服务器
chenshan@mac007:~/Desktop/github/IPython-Dashboard$redis-server & chenshan@mac007:~/Desktop/github/IPython-Dashboard$dash-server --help usage: dash-server [-h] [-H HOST] [-p PORT] [-d DEBUG] Start your IPython-Dashboard server ... optional arguments: -h, --help show this help message and exit -H HOST, --host HOST server host, default localhost -p PORT, --port PORT server port, default 9090 -d DEBUG, --debug DEBUG server port, default true chenshan@mac007:~/Desktop/github/IPython-Dashboard$dash-server Namespace(debug=True, host='0.0.0.0', port=9090) * Running on http://0.0.0.0:9090/ * Restarting with reloader Namespace(debug=True, host='0.0.0.0', port=9090)
进行探索
- *ipython仪表板教程.ipynb*:On nbviewer 或On github
目标
- 支持原始HTML可视化
- 支持python对象可视化
- 可编辑
- 渲染变量python对象时实时刷新
- 可共享,公共和私有[需要密码]
- 在笔记本中,可以将对象共享到仪表板 在仪表板中可视化该对象]
用例
- 在笔记本中探索,分享/发送结果/摘要给人们, 没有细节。
- 在私人笔记本上共享一些数据。
- 在绘制优美/稳重的 使用matplotlib/seaborn/mpld3等绘制图形。
- 想要一个交互式图形,允许人们放大/缩小、调整大小、获取 悬停提示,轻松更改图形类型。
- 想要一个实时图表。
- 想要一个协作的图表/仪表板。
明智的选择
运行测试
只需运行sudo nosetests --with-coverage--cover-package=dashboard 在本回购协议下
taotao@mac007:~/Desktop/github/IPython-Dashboard$sudo nosetests --with-coverage --cover-package=dashboard Password: ../Users/chenshan/Desktop/github/IPython-Dashboard/dashboard/tests/testCreateData.py:69: Warning: Can't create database 'IPD_data'; database exists conn.cursor().execute('CREATE DATABASE IF NOT EXISTS {};'.format(config.sql_db)) /Users/chenshan/Desktop/github/IPython-Dashboard/dashboard/server/utils.py:135: Warning: Unknown table 'ipd_data.businesses' cursor.execute(sql) /Library/Python/2.7/site-packages/pandas/io/sql.py:599: FutureWarning: The 'mysql' flavor with DBAPI connection is deprecated and will be removed in future versions. MySQL will be further supported with SQLAlchemy engines. warnings.warn(_MYSQL_WARNING, FutureWarning) ... Name Stmts Miss Cover Missing --------------------------------------------------------------------- dashboard.py 13 0 100% dashboard/client.py 1 0 100% dashboard/client/sender.py 11 3 73% 26-27, 33 dashboard/conf.py 0 0 100% dashboard/conf/config.py 29 0 100% dashboard/server.py 0 0 100% dashboard/server/resources.py 0 0 100% dashboard/server/resources/dash.py 35 10 71% 36, 55-56, 67-69, 86-89 dashboard/server/resources/home.py 40 12 70% 25, 28-30, 83-91 dashboard/server/resources/sql.py 27 11 59% 30, 52-75 dashboard/server/resources/status.py 8 1 88% 19 dashboard/server/resources/storage.py 13 5 62% 26-28, 43-47 dashboard/server/utils.py 79 18 77% 20-24, 78-80, 82-83, 86, 96, 99-100, 126-127, 140-142 dashboard/server/views.py 21 1 95% 16 --------------------------------------------------------------------- TOTAL 277 61 78% ---------------------------------------------------------------------- Ran 5 tests in 9.885s OK taotao@mac007:~/Desktop/github/IPython-Dashboard$
Change Log
- 未来
- 正面,数据块样式
- PEP 8,代码清理和重组
- 悬停提示
- 编辑模式可以调整大小
- 共享一个图形
- 共享一个仪表板
- 演示模式
- 页脚
- 统一消息显示中心
- SQL编辑器
- 登录管理
- 统一的记录器和异常报告
- 服务器端日志
- 客户端日志
- 支持python3
- 创建示例
- 在仪表板中呈现SQL
- 图表优化
- *v 0.1.6:优化图表[当前开发版本]*
- 仪表板
- 重新构造代码,遵循PEP8样式
- 创造E 1示例
- 优化图表
- SQL编辑器
- 优化页面
- 将SQL结果呈现为图形
- 仪表板
- *v 0.1.5:SQL Server日志[当前稳定版本]*
- 仪表板
- 创建一个示例
- 服务器端日志
- 支持X轴作为日期格式
- 实时更新数据帧的研究
- SQL编辑器
- SQL Server Develop:将SQL结果呈现为表视图
- 仪表板