Package: ads2bibdesk
ADS to BibDeskAPI edition(ads2bibdesk)ads2bibdeskhelps you add astrophysics articles listed on NASA/ADS to yourBibDeskdatabase using thenewADS Developer API.The program is loosely based on the originalads_bibdeskfrom J. Sick et al.However, the query is handled with a python client for the ADS API (ads, maintained by A. Casey).
Obsolete codes are replaced in favor of newer built-in Python modules with a simplified code structure.
The macOS workflow building process have been updated.
The project packaging now follows the new PyPAguideline.Due to the API usage,ads2bibdeskrequires the user to specify a personal API key, per the new NASA/ADS policy.
The instruction on how to obtain a key can be found on this official github repo:adsabs-dev-api.
In short, to obtain access to the ADS Developer API, one must do two things:Create an accountand log in to the latest version of the ADSPush the “Generate a new key” button underCustomize Settings -> Account Settings -> API TokenThe API key can be written into yourads2bibdeskpreference file~/.ads/ads2bibdesk.cfg(see thetemplate).
Following the Python/ads package’sinstruction, one can also save the key to~/.ads/dev_keyor as an environment variable namedADS_DEV_KEY.Repo:https://github.com/r-xue/ads2bibdeskPyPI:https://pypi.python.org/pypi/ads2bibdeskCredit to the contributors of the originalads_bibdesk@jonathansick@RuiPereira@keflavichfor their initial implementation.QuickstartInstallationThe command line script can be installed via:pipinstall--usergit+https://github.com/r-xue/ads2bibdesk.git# from GitHubpipinstall--userads2bibdesk# from PyPI (likely behind the GitHub version)pipinstall--user.# from a local copyTo build the macOS app andserviceworkflow, you need to further run:pipinstall--user-U--no-deps--force-reinstall--install-option="--service"ads2bibdesk# from PyPIThe option “–service” will create two filesAdd to BibDesk.workflowandAdd to BibDesk.appin~/Downloads/. To install the service, clickAdd to BibDesk.workflowand it will be moved to~/Library/Services/. For the app, just drag and drop it to any preferred location.Note:Only Python >=3.7 is supported (seebelow).With the “–user” option, you must add the user-level bin directory (e.g.,~/Library/Python/3.X/bin) to your PATH environment variable in order to launchads2bibdesk.Both the macOS service and app are based on the Automatorworkflow). They simply wrap around the command line program and serve as its shortcuts.The service shortcut will not work within some applications (e.g., Safari) on macOS >=10.14 due to new privacy and security features built in macOS (see thisissue)UsageFrom the Command lineAdd or update a new article from ADS:ads2bibdesk "1807.04291"
ads2bibdesk "2018ApJ...864L..11X"
ads2bibdesk "2013ARA&A..51..105C"
ads2bibdesk "10.3847/2041-8213/aaf872"ads2bibdeskaccepts three kinds of article identifier at this momentADS bibcode (e.g.1998ApJ...500..525S,2019arXiv190404507R)arXiv id (e.g.0911.4956).doi (e.g.10.3847/1538-4357/aafd37)A full summary ofads2bibdeskcommands is available via:ads2bibdesk --helpFrom the macOS appCopy the article identifider to the clipboard, in any applicationlaunchAdd to BibDesk.appFrom the macOS serviceHighligh and right-click on the article identifiderChoose ‘Services > Add to Bibdesk’ from the right-click menuCompatibility and DependencyI’ve only tested the program on the following macOS setup:macOS (>=10.14)Python (>=3.7.3)BibDesk (>=1.7.1)While the program likely works on slightly older software versions, I don’t focus on the backward compatibility.
On my working machine (Catalina), I set Python 3.8 from MacPorts as default:sudo port install python38 py38-pip py38-ipython
sudo port select python python38
sudo port select ipython py38-ipython
sudo port select pip pip38StatusThe following functions havealreadybeen implemented in the package:query the article metadata (title, abstract, BibTeX, etc.) with the new API by article identifiers (no more in-house ADS/arxiv HTML parsing functions)download article PDFs using the ADS gateway linksuse an authorized on-campussshproxy machine (with your public key) to download PDFs behind the journal paywalladd/update the BibDesk database and attach downloaded PDFs (largely borrowing theAppleScriptmethod from the originalads_bibdesk)Other changes from the originalads_bibdeskinclude:clean up the dependency requirementsreplace obsolete Python syntax/functions/modules with newer ones, e.g. optparser->argparser, f-string formatting, and use configparser()The macOS Automator workflow is running the installed console script rather than an embedded Python programSome less-used features from the originalads_bibdeskare gone: notably, the “ingest” and “preprint-update” modes.
But I plan to at least add back the “preprint-update” option, by scanning/updatingarticle_bibcodeassociated with arXiv). My improvement proposal can be foundhere.