11

I'm seeking a way to get my books database, stored on Goodreads, into BibTeX form. As near as I can tell, Goodreads provides no support for this directly, but does provide for CSV export (on the right). Are there tools I could used to import from the CSV file into BibTeX?


FWIW, the fields exported by goodreads are

Book Id,Title,Author,Author l-f,Additional Authors,ISBN,ISBN13,My Rating,Average Rating,Publisher,Binding,Number of Pages,Year Published,Original Publication Year,Date Read,Date Added,Bookshelves,Bookshelves with positions,Exclusive Shelf,My Review,Spoiler,Private Notes,Read Count,Recommended For,Recommended By,Owned Copies,Original Purchase Date,Original Purchase Location,Condition,Condition Description,BCID

and I can, of course, easily rearrange their order or convert to other delimiters.

5
  • 1
    It seems you can set up a custom import filter for JabRef for such a thing: jabref.sourceforge.net/help/CustomImports.php Commented Mar 18, 2012 at 21:38
  • @TorbjørnT.: That has possibilities; but ideally I'd like to avoid writing Java code.
    – orome
    Commented Mar 18, 2012 at 21:48
  • 1
    I would write a small AWK script to do that. You can probably equally easy accomplish the task using Tcl, Perl, Python, or Ruby (I know Python and barely some Perl). I would definitely not use JabRef and I would refuse to program in Java even if you point a gun into my my head. Commented Mar 19, 2012 at 4:53
  • @PredragPunosevac: I agree! Fortunately it turns out that a bit of bash and the Web did the job.
    – orome
    Commented Mar 20, 2012 at 4:44
  • freefileconvert.com/csv-bib Commented Jun 22, 2023 at 3:04

6 Answers 6

5

I won't give complete answer, but some suggestions (it would have to be really worked on to make it complete).

There are tools:

The problem is that xml2bib needs a very special format called Metadata Object Description Schema: MODS.

Below, I give example file of my thesis .bib bibliography, converted to the correct .xml MODS format by bib2xml and coverted back to a .bib file by xml2bib. It illustrates how complicated the XML format is:

I apologize for the long file listings but I don't have a reliable online file storage.

@book{beardon,
    AUTHOR = {Beardon, Alan F.},
     TITLE = {The geometry of discrete groups},
    SERIES = {Graduate Texts in Mathematics},
    VOLUME = {91},
      NOTE = {Corrected reprint of the 1983 original},
 PUBLISHER = {Springer-Verlag},
   ADDRESS = {New York},
      YEAR = {1995},
     PAGES = {xii+337},
      ISBN = {0-387-90788-2},
 XXMRCLASS = {22E40 (11F06 20H15 30F35 57N10)},
XXMRNUMBER = {1393195 (97d:22011)},
}

@article{ford,
    AUTHOR = {Ford, Lester R.},
     TITLE = {The fundamental region for a {F}uchsian group},
   JOURNAL = {Bull. Amer. Math. Soc.},
  FJOURNAL = {Bulletin of the American Mathematical Society},
    VOLUME = {31},
      YEAR = {1925},
    NUMBER = {9-10},
     PAGES = {531--539},
      ISSN = {0002-9904},
 XXMRCLASS = {Contributed Item},
XXMRNUMBER = {1561111},
       DOI = {10.1090/S0002-9904-1925-04104-X},
       URL = {http://dx.doi.org/10.1090/S0002-9904-1925-04104-X},
}

@article{k:sr_rmg,
    AUTHOR = {K{\r{u}}rka, Petr},
     TITLE = {A symbolic representation of the real {M}\"obius group},
   JOURNAL = {Nonlinearity},
  FJOURNAL = {Nonlinearity},
    VOLUME = {21},
      YEAR = {2008},
    NUMBER = {3},
     PAGES = {613--623},
      ISSN = {0951-7715},
     CODEN = {NONLE5},
 XXMRCLASS = {37F30 (37B10)},
XXMRNUMBER = {2396619 (2009j:37073)},
MRREVIEWER = {Jiri Fiser},
       DOI = {10.1088/0951-7715/21/3/012},
       URL = {http://dx.doi.org/10.1088/0951-7715/21/3/012},
}

<?xml version="1.0" encoding="UTF-8"?>
<modsCollection xmlns="http://www.loc.gov/mods/v3">
<mods ID="beardon">
    <titleInfo>
        <title>The geometry of discrete groups</title>
    </titleInfo>
    <name type="personal">
        <namePart type="given">Alan</namePart>
        <namePart type="given">F</namePart>
        <namePart type="family">Beardon</namePart>
        <role>
            <roleTerm authority="marcrelator" type="text">author</roleTerm>
        </role>
    </name>
    <originInfo>
        <issuance>monographic</issuance>
        <dateIssued>1995</dateIssued>
        <publisher>Springer-Verlag</publisher>
        <place>
            <placeTerm type="text">New York</placeTerm>
        </place>
    </originInfo>
    <typeOfResource>text</typeOfResource>
    <genre authority="marcgt">book</genre>
    <relatedItem type="host">
        <titleInfo>
            <title>Graduate Texts in Mathematics</title>
        </titleInfo>
    </relatedItem>
    <note>Corrected reprint of the 1983 original</note>
    <identifier type="isbn">0-387-90788-2</identifier>
    <identifier type="citekey">beardon</identifier>
    <part>
        <detail type="volume"><number>91</number></detail>
    </part>
</mods>
<mods ID="ford">
    <titleInfo>
        <title>The fundamental region for a Fuchsian group</title>
    </titleInfo>
    <name type="personal">
        <namePart type="given">Lester</namePart>
        <namePart type="given">R</namePart>
        <namePart type="family">Ford</namePart>
        <role>
            <roleTerm authority="marcrelator" type="text">author</roleTerm>
        </role>
    </name>
    <originInfo>
        <dateIssued>1925</dateIssued>
    </originInfo>
    <typeOfResource>text</typeOfResource>
    <relatedItem type="host">
        <titleInfo>
            <title>Bull. Amer. Math. Soc.</title>
        </titleInfo>
        <originInfo>
            <issuance>continuing</issuance>
        </originInfo>
        <genre authority="marcgt">periodical</genre>
        <genre>academic journal</genre>
        <identifier type="issn">0002-9904</identifier>
    </relatedItem>
    <identifier type="citekey">ford</identifier>
    <identifier type="doi">10.1090/S0002-9904-1925-04104-X</identifier>
    <location>
        <url>http://dx.doi.org/10.1090/S0002-9904-1925-04104-X</url>
    </location>
    <part>
        <date>1925</date>
        <detail type="volume"><number>31</number></detail>
        <detail type="number"><number>9-10</number></detail>
        <extent unit="page">
            <start>531</start>
            <end>539</end>
        </extent>
    </part>
</mods>
<mods ID="k:sr_rmg">
    <titleInfo>
        <title>A symbolic representation of the real Möbius group</title>
    </titleInfo>
    <name type="personal">
        <namePart type="given">Petr</namePart>
        <namePart type="family">K\rurka</namePart>
        <role>
            <roleTerm authority="marcrelator" type="text">author</roleTerm>
        </role>
    </name>
    <originInfo>
        <dateIssued>2008</dateIssued>
    </originInfo>
    <typeOfResource>text</typeOfResource>
    <relatedItem type="host">
        <titleInfo>
            <title>Nonlinearity</title>
        </titleInfo>
        <originInfo>
            <issuance>continuing</issuance>
        </originInfo>
        <genre authority="marcgt">periodical</genre>
        <genre>academic journal</genre>
        <identifier type="issn">0951-7715</identifier>
    </relatedItem>
    <identifier type="citekey">k:sr_rmg</identifier>
    <identifier type="doi">10.1088/0951-7715/21/3/012</identifier>
    <location>
        <url>http://dx.doi.org/10.1088/0951-7715/21/3/012</url>
    </location>
    <part>
        <date>2008</date>
        <detail type="volume"><number>21</number></detail>
        <detail type="number"><number>3</number></detail>
        <extent unit="page">
            <start>613</start>
            <end>623</end>
        </extent>
    </part>
</mods>
</modsCollection>

@Book{beardon,
author="Beardon, Alan F.",
title="The geometry of discrete groups",
series="Graduate Texts in Mathematics",
year="1995",
publisher="Springer-Verlag",
address="New York",
volume="91",
note="Corrected reprint of the 1983 original",
isbn="0-387-90788-2"
}

@Article{ford,
author="Ford, Lester R.",
title="The fundamental region for a Fuchsian group",
journal="Bull. Amer. Math. Soc.",
year="1925",
volume="31",
number="9-10",
pages="531--539",
issn="0002-9904",
doi="10.1090/S0002-9904-1925-04104-X",
url="http://dx.doi.org/10.1090/S0002-9904-1925-04104-X"
}

@Article{k:sr_rmg,
author="K{\backslash}rurka, Petr",
title="A symbolic representation of the real M{\"o}bius group",
journal="Nonlinearity",
year="2008",
volume="21",
number="3",
pages="613--623",
issn="0951-7715",
doi="10.1088/0951-7715/21/3/012",
url="http://dx.doi.org/10.1088/0951-7715/21/3/012"
}

Now: The following is an input file with header and one bibliography item (containing for each field the filed name with abc...xyz dummy text). I believe that the output XML file could be converted into the MODS format, but I'm not sure how and it will be a lot of work. The why that I thought of is replacing each string of the form <Title> to the string of XML markups that stands before the Title in the correct format.

Book Id,Title,Author,Author l-f,Additional Authors,ISBN,ISBN13,My Rating,Average Rating,Publisher,Binding,Number of Pages,Year Published,Original Publication Year,Date Read,Date Added,Bookshelves,Bookshelves with positions,Exclusive Shelf,My Review,Spoiler,Private Notes,Read Count,Recommended For,Recommended By,Owned Copies,Original Purchase Date,Original Purchase Location,Condition,Condition Description,BCID
abcBook Idxyz,abcTitlexyz,abcAuthorxyz,abcAuthor l-fxyz,abcAdditional Authorsxyz,abcISBNxyz,abcISBN13xyz,abcMy Ratingxyz,abcAverage Ratingxyz,abcPublisherxyz,abcBindingxyz,abcNumber of Pagesxyz,abcYear Publishedxyz,abcOriginal Publication Yearxyz,abcDate Readxyz,abcDate Addedxyz,abcBookshelvesxyz,abcBookshelves with positionsxyz,abcExclusive Shelfxyz,abcMy Reviewxyz,abcSpoilerxyz,abcPrivate Notesxyz,abcRead Countxyz,abcRecommended 

<row>
  <Book_Id>abcBook Idxyz</Book_Id>
  <Title>abcTitlexyz</Title>
  <Author>abcAuthorxyz</Author>
  <Author_l_f>abcAuthor l-fxyz</Author_l_f>
  <Additional_Authors>abcAdditional Authorsxyz</Additional_Authors>
  <ISBN>abcISBNxyz</ISBN>
  <ISBN13>abcISBN13xyz</ISBN13>
  <My_Rating>abcMy Ratingxyz</My_Rating>
  <Average_Rating>abcAverage Ratingxyz</Average_Rating>
  <Publisher>abcPublisherxyz</Publisher>
  <Binding>abcBindingxyz</Binding>
  <Number_of_Pages>abcNumber of Pagesxyz</Number_of_Pages>
  <Year_Published>abcYear Publishedxyz</Year_Published>
  <Original_Publication_Year>abcOriginal Publication Yearxyz</Original_Publication_Year>
  <Date_Read>abcDate Readxyz</Date_Read>
  <Date_Added>abcDate Addedxyz</Date_Added>
  <Bookshelves>abcBookshelvesxyz</Bookshelves>
  <Bookshelves_with_positions>abcBookshelves with positionsxyz</Bookshelves_with_positions>
  <Exclusive_Shelf>abcExclusive Shelfxyz</Exclusive_Shelf>
  <My_Review>abcMy Reviewxyz</My_Review>
  <Spoiler>abcSpoilerxyz</Spoiler>
  <Private_Notes>abcPrivate Notesxyz</Private_Notes>
  <Read_Count>abcRead Countxyz</Read_Count>
  <Recommended_For>abcRecommended Forxyz</Recommended_For>
  <Recommended_By>abcRecommended Byxyz</Recommended_By>
  <Owned_Copies>abcOwned Copiesxyz</Owned_Copies>
  <Original_Purchase_Date>abcOriginal Purchase Datexyz</Original_Purchase_Date>
  <Original_Purchase_Location>abcOriginal Purchase Locationxyz</Original_Purchase_Location>
  <Condition>abcConditionxyz</Condition>
  <Condition_Description>abcCondition Descriptionxyz</Condition_Description>
  <BCID>abcBCIDxyz</BCID>
</row>
4

Zotero
I do not use Goodreads, but I suggest that you try Zotero, and see if Zotero can import directly. Maybe it is able to fetch all your books directly in one operation. Zotero standalone works with different browser and on different platforms.

Try it, it is free so you do not waste any money.

MarcEdit + Bibutils
A two step solution is using MarcEdit: You can import a delimited file (f.ex. CSV) directly. Then it is just to save it to any suitable format supported by your .bib-file manager. If you need to clean up or manipulate the CSV-files, you can use Sam Franche’s CSVed.

Complete solution: Import your CSV-files into MarcEdit. Save as MODS-file. You can then use bibutils to convert from MODS-format into bibtex, as recommended by tohecz.

You can also import a MODS-file exported from MarcEdit into Zotero, clean it up and export it to bibtex-format.

Jabref
Jabref can import several formats, but I am not absolute sure any of those can be exported from MarcEdit. JabRef also read from SQL databases (MySQL etc). You can import your CSV-files into a MySQL table, let JabRef import it and export it as an .bib-file.

3
  • Ad MarcEdit: Do you know any such "suitable format"?
    – yo'
    Commented Mar 19, 2012 at 16:14
  • I don't argue, I asked about MarcEdit.
    – yo'
    Commented Mar 19, 2012 at 20:00
  • ... then I think that MarcEdit+bibutils can provide a complete solution for the original poster ;)
    – yo'
    Commented Mar 19, 2012 at 20:22
3

Since the CSV has an ISBN for each book, and since all of the information I need for BibTeX can be reconstructed from the ISBN, all I need to do is use the ISBN column from the CSV to create an array, and then generate a file containing the corresponding BibTeX information:

#!/bin/bash
#Generate a BibTeX bibliography from an array of ISBNs

array=(<pasted column of ISBNs>)

rm goodreads.bib
for isbn in "${isbnarray[@]}"
do
    curl http://manas.tungare.name/software/isbn-to-bibtex/isbn-service?isbn=$isbn >> goodreads.bib
done

And that's it.

1
  • No worries. I'm still interested in a general answer.
    – orome
    Commented Mar 20, 2012 at 12:32
3

I have a simplest solutions and more trustfull I think. In https://doi.org/ you have all the DOIs registered, and the website just have bib format return. If you access https://doi.org/$doi, you get all the informations releated.

So, you can use as follow:

doi="10.1007/978-3-319-46031-4_16"
curl -LH "Accept: application/x-bibtex; charset=utf-8" https://doi.org/$doi

And you get:

@incollection{Solberg_2016,
    doi = {10.1007/978-3-319-46031-4_16},
    url = {https://doi.org/10.1007%2F978-3-319-46031-4_16},
    year = 2016,
    month = {dec},
    publisher = {Springer International Publishing},
    pages = {147--149},
    author = {Arnor Solberg and Peter Matthews},
    title = {Conclusion and Future Research},
    booktitle = {Model-Driven Development and Operation of Multi-Cloud Applications}
}

In my case, I needed to convert because Springer doesnt have bib format to export. So I export to CSV, isolated DOI column and save in a file named doi.txt (1 DOI per line) and then, I created a simplest script.

for doi in `cat doi.txt`
    do echo "Downloading line > $doi"
    curl -LH "Accept: application/x-bibtex; charset=utf-8" https://doi.org/$doi >> result.bib;
done
3
  • I know that is a beginner question, but... What can I do to run this script? "for doi in cat doi.txt do echo "Downloading line > $doi" curl -LH "Accept: application/x-bibtex; charset=utf-8" doi.org/$doi >> result.bib;" Thanks! Commented Jun 23, 2020 at 2:20
  • 1
    @LucasBonino This script runs in command prompt. Press Windows Key+R key in windows and write cmd.exe, consequently press Enter to launch command prompt. Then paste the above script. Modify it to as per your requirement.
    – Programmer
    Commented Aug 17, 2020 at 10:47
  • This is a bash/shellscript! Commented May 24 at 8:37
2

Tellico can import from csv and then exporto to bibtex

1
  • Welcome to TeX.SX, and thank you for sharing your answer! If you want, you can have a look at our starter guide to familiarize yourself further with our format.
    – ebosi
    Commented Jun 7, 2016 at 7:10
0

enter image description hereenter image description here

If you use zotero, add items by identifier as on picture - simply - insert into doi values separated by "," as follows: 10.1007/s11831-022-09729-4, 10.1007/978-3-030-85739-4

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .