How to automatically create bibtex entries for ISMRM abstracts

Posted on October 5, 2016
Tags: howto, python, mri

citeISMRM is a small python commandline tool to to collect bibtex entries from the proceedings of the ISMRM annual meeting.

I generally use bibtex and the incredible useful emacs package org-ref to manage scientific references. With this setup I became acustomed to almost never write bibtex entries manually.

There is no way to automatically get bibtex entries for the “abstracts” (very brief conference papers) of the most important conference in my field, the annual meeting of the International Society for Magnetic Resonance in Medicine (ISMRM).

Fortunately, there is an archive website for some time now, where you can search a database of all abstracts fed in a more or less consistent html template.

It was useful to quickly write a little python commandline program to pull all necessary information from this site to build a bibtex entry for each abstract, given the abstract year and program number or the corresponding url. This is not very sophisticated but enough to scratch my itch.

You can find the source code here.

It includes some not so nice hard coded variable settings, because abstract html pages differed slightly from year to year. Basically I only assemble the abstract link, request the corresponding html page via urllib.request, parse it with beautifulsoup and fill the found abstract title and authour tag into a dictionary. Finally bibtexparser formates a bibtex entry string, which can be printed to stdout or written to a file. Wrapped in a function using argparser it makes a little commandline program.

I think the correct bibtex entry type is “@inproceedings”, which has the following required and optional fields (see “$ texdoc bibtex”).

inproceedings An article in a conference proceedings. Required fields: author, title, booktitle, year. Optional fields: editor, volume or number, series, pages, address, month, organization, publisher, note.

Here is how to use citeISMRM:

usage: citeISMRM [-h] [-y YEAR] [-n NUMBER] [-l LINK] [-w WRITE] [-wd]
                 [-a APPEND]

Create bibtex for ISMRM abstract.

optional arguments:
  -h, --help            show this help message and exit
  -y YEAR, --year YEAR  year
  -n NUMBER, --number NUMBER
                        number (in the proceedings)
  -l LINK, --link LINK  abstract link
  -w WRITE, --write WRITE
                        write to file
  -wd, --write-default
  -a APPEND, --append APPEND
                        append to file