Github项目推荐 | Watermark - IPython实用扩展

2019 年 1 月 7 日 AI研习社

Watermark - An IPython magic extension for printing date and time stamps, version numbers, and hardware information

by Sebastian Raschka

【社长提醒】本文的划线部分链接需要点击底部阅读原文进行访问

项目地址:

https://github.com/rasbt/watermark


  目录

  • 示例

  • 安装与更新

  • 用法

  • 更新日志


  示例

更多示例可以在项目的 Jupyter notebook 中查看


  安装与更新

执行以下命令即可安装Watermark:

pip install watermark

或者直接从GitHub安装最新的开发版本:

注意:

要想移除旧版本 Watermark 的安装(通过已经弃用的 %install_ext  魔法扩展安装),只需要将它从 .ipython/extensions/ 目录中删除即可,这个目录通常位于用户的主目录中。


  用法

安装成功后,可以通过以下方式加载 watermark 魔术扩展:

%load_ext watermark

想要获取所有命令的用法概述,请输入以下命令:

%watermark?

结果大致如下:

%watermark [-a AUTHOR] [-d] [-n] [-t] [-i] [-z] [-u] [-c CUSTOM_TIME]
              [-v] [-p PACKAGES] [-h] [-m] [-g] [-w]

IPython magic function to print date/time stamps
and various system information.

optional arguments:
-a AUTHOR, --author AUTHOR
                      prints author name
-d,  --date            prints current date as YYYY-mm-dd
-n,  --datename        prints date with abbrv. day and month names
-t,  --time            prints current time as HH-MM-SS
-i,  --iso8601         prints the combined date and time including the time
                      zone in the ISO 8601 standard with UTC offset
-z,  --timezone        appends the local time zone
-u,  --updated         appends a string "Last updated: "
-c CUSTOM_TIME, --custom_time CUSTOM_TIME
                      prints a valid strftime() string
-v,  --python          prints Python and IPython version
-p PACKAGES, --packages PACKAGES
                      prints versions of specified Python modules and
                      packages
-h,  --hostname        prints the host name
-m,  --machine         prints system and machine info
-g,  --githash         prints current Git commit hash
-r,  --gitrepo         prints current Git remote address
-b,  --gitbranch       prints the current Git branch (new in v1.6)
-iv, --iversion        print name and version of all imported packages      
-w,  --watermark       prints the current version of watermark


  更新日志

v. 1.8.0 (January 02, 2019)

-iv/--iversion 标志现在还可以显示“从X导入Y并将X.Y导入为Y ”的包版本  ,例如:

import scipy as sp
from sklearn import metrics
import numpy.linalg as linalg

%watermark --iversions

执行返回以下结果:

scipy     1.1.0
sklearn   0.20.1
numpy     1.15.4


v. 1.7.0 (October 13, 2018)

(来自 James Myatt 的贡献)

  • 无法导入的包/模块版本显示为“未安装”

  • 无法找到版本属性的包/模块版本显示为“未知”

  • 将Python 3.6和3.7添加到Travis CI构建中

  • 将分类器添加到setuptools配置中

更多更新日志,请访问 项目 查看


项目地址:

https://github.com/rasbt/watermark

【AI求职百题斩 - 每日一题】

来看看今天的题目吧!

想知道正确答案?

点击今日推文【第三条】即可答题获取!

点击 阅读原文 查看本文更多内容

登录查看更多
0

相关内容

【资源】100+本免费数据科学书
专知会员服务
106+阅读 · 2020年3月17日
【书籍推荐】简洁的Python编程(Clean Python),附274页pdf
专知会员服务
175+阅读 · 2020年1月1日
【电子书】Flutter实战305页PDF免费下载
专知会员服务
20+阅读 · 2019年11月7日
【新书】Python编程基础,669页pdf
专知会员服务
187+阅读 · 2019年10月10日
机器学习入门的经验与建议
专知会员服务
91+阅读 · 2019年10月10日
机器学习相关资源(框架、库、软件)大列表
专知会员服务
38+阅读 · 2019年10月9日
机器学习在材料科学中的应用综述,21页pdf
专知会员服务
47+阅读 · 2019年9月24日
【电子书推荐】Data Science with Python and Dask
专知会员服务
43+阅读 · 2019年6月1日
Github项目推荐 | Pytorch TVM 扩展
AI研习社
11+阅读 · 2019年5月5日
一个牛逼的 Python 调试工具
机器学习算法与Python学习
15+阅读 · 2019年4月30日
GitHub 热门:别再用 print 输出来调试代码了
Python开发者
27+阅读 · 2019年4月24日
Github项目推荐 | 知识图谱文献集合
AI研习社
26+阅读 · 2019年4月12日
Github项目推荐 | pikepdf - Python的PDF读写库
AI研习社
9+阅读 · 2019年3月29日
Github项目推荐 | RecQ - Python推荐系统框架
AI研习社
8+阅读 · 2019年1月23日
Arxiv
38+阅读 · 2020年3月10日
Meta-Learning with Implicit Gradients
Arxiv
13+阅读 · 2019年9月10日
Arxiv
7+阅读 · 2018年6月8日
Arxiv
11+阅读 · 2018年1月15日
VIP会员
相关VIP内容
【资源】100+本免费数据科学书
专知会员服务
106+阅读 · 2020年3月17日
【书籍推荐】简洁的Python编程(Clean Python),附274页pdf
专知会员服务
175+阅读 · 2020年1月1日
【电子书】Flutter实战305页PDF免费下载
专知会员服务
20+阅读 · 2019年11月7日
【新书】Python编程基础,669页pdf
专知会员服务
187+阅读 · 2019年10月10日
机器学习入门的经验与建议
专知会员服务
91+阅读 · 2019年10月10日
机器学习相关资源(框架、库、软件)大列表
专知会员服务
38+阅读 · 2019年10月9日
机器学习在材料科学中的应用综述,21页pdf
专知会员服务
47+阅读 · 2019年9月24日
【电子书推荐】Data Science with Python and Dask
专知会员服务
43+阅读 · 2019年6月1日
相关资讯
Github项目推荐 | Pytorch TVM 扩展
AI研习社
11+阅读 · 2019年5月5日
一个牛逼的 Python 调试工具
机器学习算法与Python学习
15+阅读 · 2019年4月30日
GitHub 热门:别再用 print 输出来调试代码了
Python开发者
27+阅读 · 2019年4月24日
Github项目推荐 | 知识图谱文献集合
AI研习社
26+阅读 · 2019年4月12日
Github项目推荐 | pikepdf - Python的PDF读写库
AI研习社
9+阅读 · 2019年3月29日
Github项目推荐 | RecQ - Python推荐系统框架
AI研习社
8+阅读 · 2019年1月23日
Top
微信扫码咨询专知VIP会员