用于高能物理参考的命令行辅助工具。

heprefs的Python项目详细描述


高能物理参考文献:cli

screen shot

你认为命令太长了吗?只需通过编辑.zshrc来配置shell;例如,

function xa()      { if [ $# != 0 ]; then for i in $*; do heprefs abs $i; done; fi }
function xx()      { if [ $# != 0 ]; then for i in $*; do heprefs pdf $i; done; fi }
function xget()    { if [ $# != 0 ]; then for i in $*; do heprefs get -o $i; done; fi }
function xsource() { if [ $# != 0 ]; then for i in $*; do heprefs source -u $i; done; fi }

(或见下文)您只需键入xget 1802.07720 1708.00283等即可下载多个PDF!

设置

对于python 2或3。

安装

$ pip install git+https://github.com/misho104/heprefs.git

Collecting git+https://github.com/misho104/heprefs.git  Cloning https://github.com/misho104/heprefs.git to /private/tmp/pip-wjd8srsu-build...Successfully installed arxiv-0.1.1 click-6.7 feedparser-5.2.1 heprefs-0.1.0 requests-2.13.0

或者您可以通过安装特定版本,例如

$ pip install git+https://github.com/misho104/heprefs.git@v0.1.0       # for v0.1.0$ pip install git+https://github.com/misho104/heprefs.git@development  # for development version

升级

$ pip install git+https://github.com/misho104/heprefs.git --upgrade

卸载

$ pip uninstall heprefs

使用量

用浏览器打开摘要页
$ heprefs abs 1505.02996               # arXiv$ heprefs abs hep-th/9711200           # arXiv (old style)$ heprefs abs ATLAS-CONF-2017-018      # CERN Document Server$ heprefs abs 10.1038/nphys3005        # DOI (inspireHEP)$ heprefs abs "fin a Ellis"# inspireHEP (first result is only shown)$ heprefs abs 9709356# equivalent to 'hep-ph/9709356'

通过浏览器打开PDF,或下载PDF文件

CD或InspireHep查询可能找不到PDF。

$ heprefs pdf 1505.02996               # arXiv$ heprefs pdf ATLAS-CONF-2017-018      # CERN Document Server$ heprefs get 10.1038/nphys3005        # DOI (inspireHEP)$ heprefs get "fin a Ellis"# inspireHEP (first result)$ heprefs get -o "fin a Giudice"# open the PDF file

显示信息
$ heprefs authors 1505.02996
$ heprefs first_author hep-th/9711200
$ heprefs title 10.1038/nphys3005
$ heprefs short_info ATLAS-CONF-2017-018

高级使用

指定搜索引擎

有三种类型:arxiv、inspirehep和cds。它们是自动猜测的,但您可以指定类型:

$ heprefs abs -t arxiv 1505.02996           # arXiv$ heprefs abs -t cds   "top asymmetry"# CDS$ heprefs abs -t ins   "top asymmetry"# inspireHEP$ heprefs abs        ATLAS-CONF-2017-018    # guessed as CDS search$ heprefs abs -t ins ATLAS-CONF-2017-018    # forced to use inspireHEP

命令太长?

在你的.zshrc.bashrc等…

alias xa='heprefs abs'
alias xx='heprefs pdf'
alias xget='heprefs get'

或者如果要处理多个参数,

function xa()      { if [ $# != 0 ]; then for i in $*; do heprefs abs $i; done; fi }
function xx()      { if [ $# != 0 ]; then for i in $*; do heprefs pdf $i; done; fi }
function xget()    { if [ $# != 0 ]; then for i in $*; do heprefs get -o $i; done; fi }
function xsource() { if [ $# != 0 ]; then for i in $*; do heprefs source -u $i; done; fi }

(您可能也想使用Inspire Search,但这不是本软件的功能。)

function browser() {
  google-chrome $* &             # on Linux
  # open $* -a Google\ Chrome    # on macOS
}

function fin() {
  local query; if [ $# != 0 ]; then; for i in $*; do; query="$query+$i"; done; fi
  query=`echo $query | sed 's/^\+//'`
  browser http://inspirehep.net/search\?p=fin+$query &
}

function insp() {
  local query; if [ $# != 0 ]; then; for i in $*; do; query="$query+$i"; done; fi
  query=`echo $query | sed 's/^\+//'`
  browser http://inspirehep.net/search\?p=$query &
}

现在您可以调用

$ xa 1505.02996
$ xget 9709356$ fin a Giudice and Masiero
$ fin bb hep-th/9711200
$ insp relaxion

开发人员的调试命令
$ heprefs debug 1505.02996

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
Java NIO选择器最多只能选择50个SelectionKeys?   java阻止ImageButton创建新活动   为什么Java方法“Arrays.copyOf”处理中的整数数组与处理对象数组时的行为不同   java将安卓 1.6日历字段提取到vcal   将字符串转换为双精度后的java问题   java使用Webflux,是否可以使用AOP获取用于日志记录的ServerHttpRequest   java与jTextArea的基本区别是什么。setText()和jTextArea。append()方法?   java程序执行时间|将值保存到文件或数据结构?   java如何将表示字符的整数转换为字符串?   Java LWJGL新的渲染问题windows   java GUI提供异常   java创建第二个对象使类的函数不再工作   如何在java中将000验证为3位数字?   java bigO算法的时间复杂度,可以在不重复的情况下找到最长的子串   在30像素内点击按钮后,java在两个图像之间转换   java eclipse maven nexus不可解父pom   当存在其他SecurityConstraint时,java TransportGuary机密将被忽略   重新连接后激发的java Red5客户端流断开事件   javafx聊天应用程序中连接客户端的java问题