Friday, 30 December 2016

How to manage publications on a local computer


I would like to find a better way of naming publications which I store on my local computer as PDFs. So far I have been doing something like this:


Albano R., Sole A., Adamowski J., Mancusi L. (2014) - A GIS-based model to estimate flood consequences and the degree of accessibility and operability of strategic emergency response structures in urban areas.pdf


This presents a couple of disadvantages:




  • Titles can be extremely long. This causes problems in certain operating systems or software such as OneDrive. You can only have so many characters in a filename...

  • Not all publications can follow this format. The above is OK for journal papers and theses, but not so much for books or other kinds of publications.


I would like to have a consistent way to manage such a database. I thought of keeping the publication metadata such as authors, date of publication, type of publication and type in a separate text or excel file and naming the PDF files by ID, like 1.pdf, 2.pdf, etc. This could work, but it would require referring to and managing a spreadsheet which would contain all the meta data.


Is there a simple method or perhaps lightweight software that I can use which can help me with this sort of task?


EDIT


I didn't really like the way @Jonas Stein's script is set up, though I do owe him the inspiration and indication to use JabRef. Here's my alternative script:


import bibtexparser
import os
from shutil import copyfile


filename = 'db.bib'
out_folder = 'out'

with open(filename) as bibtex_file:
db = bibtexparser.load(bibtex_file)

for entry in db.entries:
print(entry['file'])
id = entry['ID']

file = entry['file'].split(':')[1]

copyfile(file, os.path.join(out_folder, id)+'.pdf')


print('done')

It's much more compact and does the job.



Answer



I manage publications with JabRef in a bibtex database. It is possible to add a link to the filename with JabRef in the bibtex database.



A python script pybibtexcleaner transcribes the special characters in the title and moves all sorted files to one folder with file names in the format


bibkey-title.pdf

The script will generate from a bib entry


@Article{Stein2017a,
author = {J. Stein and M. Baum and S. Holbein and T. Finger and T. Cronert and C. Tölzer and T. Fröhlich and S. Biesenkamp and K. Schmalzl and P. Steffens and C.H. Lee and M. Braden},
title = {Control of Chiral Magnetism Through Electric Fields in Multiferroic Compounds above the Long-Range Multiferroic Transition},
journal = {Physical Review Letters},
year = {2017},
volume = {119},

number = {17},
doi = {10.1103/physrevlett.119.177201},
file = {:../included/119.177201.pdf},
publisher = {American Physical Society ({APS})}
}

the new filename


Stein2017a-Control_of_Chiral_Magnetism_Through_Electric_Fields_in_Multiferroic_Compounds_above_the_Long-Range_Multiferroic_Transition.pdf`

and copy the file to ../articles/ and also adjust the path in the .bib file.



It is very useful if the filenames start with the bibkey. You should always use all digits of the year.


The script can also transcribe chemical formulas in a readable way, if they are introduced with \ce as in \ce{H2O}.


You can keep track of your work with git and you can restore old versions or synchronize the literature database on your different systems.


ps: I use the old stable 3.8.2 version of JabRef, because the new versions 4.x were less stable when I tried them. The user has better control on the rename process with the short python script and can easily adjust it to the needs, but recent JabRef versions are shipped with similar functionality.


No comments:

Post a Comment

evolution - Are there any multicellular forms of life which exist without consuming other forms of life in some manner?

The title is the question. If additional specificity is needed I will add clarification here. Are there any multicellular forms of life whic...