Difference between revisions of "SPIRES script"

From String Theory Wiki
Jump to: navigation, search
m (version 0.3)
Line 2: Line 2:
  
 
===download===
 
===download===
Download the [[SPIRES script|Spires.py]] and [[Listcitations.py|listcitations.py]].
+
Download the [[Spires.py|SPIRES script]] and [[Listcitations.py|listcitations.py]].
 
 
  
 
===installation on a GNU/Linux system===
 
===installation on a GNU/Linux system===
Line 12: Line 11:
 
at the command line and see what happens.
 
at the command line and see what happens.
  
If python is present download the [[SPIRES script|Spires.py]] and run it by typing
+
If python is present download the [[Spires.py|SPIRES script]] and run it by typing
 
<pre>
 
<pre>
 
python spires.py hep-th/9711200
 
python spires.py hep-th/9711200
Line 21: Line 20:
 
The typical accepted inputs are the usual arXiv references, the SPIRES TeX key or a SPIRES-style journal reference
 
The typical accepted inputs are the usual arXiv references, the SPIRES TeX key or a SPIRES-style journal reference
 
<pre>
 
<pre>
./spires.py hep-th/9711200
+
python spires.py hep-th/9711200
./spires.py 0705.0303
+
python spires.py 0705.0303
./spires.py Maldacena:1997re
+
python spires.py Maldacena:1997re
./spires.py CMPHA,43,199
+
python spires.py CMPHA,43,199
 +
python spires.py Phys.Rev.,D52,5783
 
</pre>
 
</pre>
  
Line 48: Line 48:
 
To see all the options access the help page
 
To see all the options access the help page
 
<pre>
 
<pre>
tom@fyodor:~$ ./spires.py -h
+
tom@fyodor:~$ python spires.py -h
 
SPIRES script
 
SPIRES script
 
Usage:
 
Usage:
Line 79: Line 79:
 
Each item can be specified individually with switches, e.g. -t for title, -a for authors, -b for BiBTeX entry, -c for SPIRES TeX key.  For example
 
Each item can be specified individually with switches, e.g. -t for title, -a for authors, -b for BiBTeX entry, -c for SPIRES TeX key.  For example
 
<pre>
 
<pre>
tom@fyodor:~$ ./spires.py hep-th/9711200 -at
+
tom@fyodor:~$ python spires.py hep-th/9711200 -at
 
Maldacena, Juan M.
 
Maldacena, Juan M.
 
The large N limit of superconformal field theories and supergravity
 
The large N limit of superconformal field theories and supergravity
Line 86: Line 86:
 
If you have a BiBTeX database file such as library.bib then the script can update the file with the BiBTeX entry if it is not already present
 
If you have a BiBTeX database file such as library.bib then the script can update the file with the BiBTeX entry if it is not already present
 
<pre>
 
<pre>
./spires.py hep-th/9711200 --library library.bib
+
python spires.py hep-th/9711200 --library library.bib
 +
</pre>
 +
 
 +
To download a PDF of an eprint the [http://www.arxiv.org/ arXiv]
 +
<pre>
 +
python spires.py hep-th/9711200 --download some_folder/
 
</pre>
 
</pre>
  
 
===listcitations.py===
 
===listcitations.py===
 +
To use this program you must download the [[Spires.py|SPIRES script]] and [[Listcitations.py|listcitations.py]].
  
 
This program reads a TeX file and then looks up all the \cite{...} references and outputs the bibitems. The typical accepted inputs are the usual arXiv references, the SPIRES TeX key or a SPIRES-style journal reference.  With no options it will output bibitems
 
This program reads a TeX file and then looks up all the \cite{...} references and outputs the bibitems. The typical accepted inputs are the usual arXiv references, the SPIRES TeX key or a SPIRES-style journal reference.  With no options it will output bibitems
 
<pre>
 
<pre>
./listcitations.py tex_file.tex
+
python listcitations.py tex_file.tex
 
</pre>
 
</pre>
 
It can also output BiBTeX entries too
 
It can also output BiBTeX entries too
 
<pre>
 
<pre>
./listcitations.py tex_file.tex -b
+
python listcitations.py tex_file.tex -b
 
</pre>
 
</pre>
 
To see all the options access the help page
 
To see all the options access the help page
 
<pre>
 
<pre>
tom@tarkovsky:~$ ./listcitations.py -h
+
tom@tarkovsky:~$ python listcitations.py -h
 
list citations script
 
list citations script
 
Usage:
 
Usage:
Line 127: Line 133:
 
===technical details===
 
===technical details===
  
The code is very modular so it is easy to write your own programs using the functions defined in spires.py.  Just import the functions in spires.py with <code>import spires</code>; you can use spires.py as a library of SPIRES-related functions (see [[#listcitations.py|listcitations.py]] as an example).
+
The code is very modular so it is easy to write your own programs using the functions defined in spires.py.  Just import the functions in spires.py with <code>import spires</code>; you can use spires.py as a library of SPIRES-related functions (see [[Listcitations.py|listcitations.py]] as an example).
  
 
===comments and bugs===
 
===comments and bugs===
 
If you have any comments or find bugs, please contact [[User:Tom|Tom]].
 
If you have any comments or find bugs, please contact [[User:Tom|Tom]].
 +
 +
===thanks===
 +
Thanks to Travis C. Brooks of [http://www.slac.stanford.edu/spires/ SPIRES] for his help and [http://theory.tifr.res.in/~kevin/ Kevin Goldstein] for pointing out the python <code>urllib</code> library.
  
 
===licence===
 
===licence===
 
This script is Copyright 2007 Tom Brown and made available under the [http://www.gnu.org/copyleft/gpl.html GNU General Public Licence].
 
This script is Copyright 2007 Tom Brown and made available under the [http://www.gnu.org/copyleft/gpl.html GNU General Public Licence].

Revision as of 18:48, 11 July 2007

SPIRES script is a program written in the python programming language that accesses information on papers in the SPIRES online high energy physics literature database. It can access title, author, bibitem and BiBTeX records, update your local BiBTeX library and download papers from the arXiv. A separate program listcitations.py reads through a TeX file and then looks up all the \cite{...} references and outputs the bibitems. Although originally written for the GNU/Linux command line, the code should be portable enough to run on any operating system with a python interpreter.

download

Download the SPIRES script and listcitations.py.

installation on a GNU/Linux system

The script requires the python interpreter to be installed on your system. This is automatically installed on most GNU/Linux distributions, but check it is there by typing

python

at the command line and see what happens.

If python is present download the SPIRES script and run it by typing

python spires.py hep-th/9711200

usage

The typical accepted inputs are the usual arXiv references, the SPIRES TeX key or a SPIRES-style journal reference

python spires.py hep-th/9711200
python spires.py 0705.0303
python spires.py Maldacena:1997re
python spires.py CMPHA,43,199
python spires.py Phys.Rev.,D52,5783

If no options are specified all possible outputs will be displayed

tom@fyodor:~$ python spires.py hep-th/9711200
@Article{Maldacena:1997re,
     author    = "Maldacena, Juan M.",
     title     = "The large N limit of superconformal field theories and
                  supergravity",
     journal   = "Adv. Theor. Math. Phys.",
     volume    = "2",
     year      = "1998",
     pages     = "231-252",
     eprint    = "hep-th/9711200",
     SLACcitation  = "%%CITATION = HEP-TH/9711200;%%"
}
Maldacena, Juan M.
The large N limit of superconformal field theories and supergravity
\cite{Maldacena:1997re}

To see all the options access the help page

tom@fyodor:~$ python spires.py -h
SPIRES script
Usage:
python spires.py reference [ -hbiatcev ] [ --help ] [ --library library.bib ] [ --download download_path/ ]
"reference" must be a standard arXiv reference, e.g. hep-th/9711200, 0705.0303, Maldacena:1997re or a SPIRES journal reference, e.g. CMPHA,43,199
Options:
-h, --help
displays this help message
-b
displays the BiBTeX entry
-i
displays the bibitem entry
-a
displays the author(s)
-t
displays the title
-c
displays the TeX citation key
-e
displays everything
-v
verbose mode

--download download_path/
for arXiv references downloads a pdf of the paper from the arXiv to the directory download_path/
--library library.bib
if it is not already in library.bib, appends the BiBTeX entry to library.bib; use at your own risk

Each item can be specified individually with switches, e.g. -t for title, -a for authors, -b for BiBTeX entry, -c for SPIRES TeX key. For example

tom@fyodor:~$ python spires.py hep-th/9711200 -at
Maldacena, Juan M.
The large N limit of superconformal field theories and supergravity

If you have a BiBTeX database file such as library.bib then the script can update the file with the BiBTeX entry if it is not already present

python spires.py hep-th/9711200 --library library.bib

To download a PDF of an eprint the arXiv

python spires.py hep-th/9711200 --download some_folder/

listcitations.py

To use this program you must download the SPIRES script and listcitations.py.

This program reads a TeX file and then looks up all the \cite{...} references and outputs the bibitems. The typical accepted inputs are the usual arXiv references, the SPIRES TeX key or a SPIRES-style journal reference. With no options it will output bibitems

python listcitations.py tex_file.tex

It can also output BiBTeX entries too

python listcitations.py tex_file.tex -b

To see all the options access the help page

tom@tarkovsky:~$ python listcitations.py -h
list citations script
Usage:
python listcitations.py TeX_file_name.tex [ -hbiv ] [ --help ]

TeX_file_name must contain citations as standard arXiv references,
e.g. hep-th/9711200, 0705.0303, Maldacena:1997re or SPIRES journal
references, e.g. CMPHA,43,199

Options:
-h, --help
displays this help message
-b
displays the BiBTeX entry
-i
displays the bibitem entry
-v
verbose mode

future features

  • allow alias citations such as \cite{mypaper} for listcitations.py

technical details

The code is very modular so it is easy to write your own programs using the functions defined in spires.py. Just import the functions in spires.py with import spires; you can use spires.py as a library of SPIRES-related functions (see listcitations.py as an example).

comments and bugs

If you have any comments or find bugs, please contact Tom.

thanks

Thanks to Travis C. Brooks of SPIRES for his help and Kevin Goldstein for pointing out the python urllib library.

licence

This script is Copyright 2007 Tom Brown and made available under the GNU General Public Licence.