Skip to content

A minimal Python script to shorten DOIs in bibtex files

License

Notifications You must be signed in to change notification settings

domoritz/shorty

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

shorty

A minimal Python script to shorten DOIs in bibtex files using https://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

About

A minimal Python script to shorten DOIs in bibtex files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published