Skip to content
GitHub no longer supports this web browser. Learn more about the browsers we support.
A minimal Python script to shorten DOIs in bibtex files
TeX Python
Branch: master
Clone or download
Cannot retrieve the latest commit at this time.
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
images
.gitignore
LICENSE
README.md
demo.bib
main.py

README.md

shorty

A minimal Python script to shorten DOIs in bibtex files using http://shortdoi.org/. The shortener is offered by the International DOI Foundation.

Use it with (or follow long instructions below)

curl -s https://raw.githubusercontent.com/domoritz/shorty/master/main.py | python /dev/stdin long.bib > short.bib

What does it do?

It converts

@article{Moritz2017,
	doi = {10.1145/3025453.3025456},
	year = {2017},
	publisher = {{ACM} Press},
	author = {Dominik Moritz and Danyel Fisher and Bolin Ding and Chi Wang},
	title = {Trust,  but Verify: Optimistic Visualizations of Approximate Queries for Exploring Big Data},
	booktitle = {Proceedings of the 2017 {CHI} Conference on Human Factors in Computing Systems  - {CHI} {\textquotesingle}17}
}

to (notice the shorter DOI!)

@article{Moritz2017,
	doi = {10/b7jt},
	year = {2017},
	publisher = {{ACM} Press},
	author = {Dominik Moritz and Danyel Fisher and Bolin Ding and Chi Wang},
	title = {Trust,  but Verify: Optimistic Visualizations of Approximate Queries for Exploring Big Data},
	booktitle = {Proceedings of the 2017 {CHI} Conference on Human Factors in Computing Systems  - {CHI} {\textquotesingle}17}
}

Why do I want to use it?

You may have a page limit or you just want your references to be shorter to fit on a single (or two, or three, or n) page.

How do I use it?

Download the script. Then copy your bibtex file to a new file (here demo.bib but you can call it long.bib). Then run

python main.py demo.bib > short.bib

Alternatively, you can pipe in the the content

cat demo.bib | python main.py > short.bib
You can’t perform that action at this time.