Although mendeley is convenient, it lacks proper support for documents created using version control systems like subversion. Usually, it is a bad idea to put the BibTeX file of the project under version control. Using the API of mendeley, there is way to
- Avoid duplicate entries with the same doi but different citation keys.
- Avoid manual checking whether a local BibTeX entry has been added to the mendeley database.
- Avoid searching for the proper citation keys for legacy documents.
- Avoid searching missing doi entries in the local BibTeX file.
- Automatically copy mendeley data to your local BibTeX file.
Especially the last point is useful: only use a citation key in your LaTeX document and run the script below. It will update your local mendeley-export.bib. This script only works on BibTeX files of this name.
How to install
- Download the script, extract the files into any folder that is part of your $PYTHONPATH. Please note that the folder you select will be used as storage for the cached data, as well.
- Make sure that you have python installed. Your installation has to include oauth2, requests and mendeley_client.
- Get your own API key and add it to config.json.
- Properly set the variable group_to_sync. This has to be one group name from Mendeley.
How to use
- Enter the directory with your LaTeX files and call bibsync.py. When it is called for the first time, it will download the metadata of the entire document group after you have confirmed the access via OAuth. This will take some time.
- If the file mendeley-export.bib does not exist, it will be created. bibsync.py will only work on this file.
- You should get something like this as output: