Skip to main content

Add articles from the new NASA/SAO ADS to your BibDeskbibliography (based on ads_bibdesk from J. Sick et al.).

Project description

ADS to BibDesk API edition (ads2bibdesk)

ads2bibdesk helps you add astrophysics articles listed on NASA/ADS to your BibDesk database using the new ADS Developer API.

The program is loosely based on the original ads_bibdesk from 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 PyPA guideline.

Due to the API usage, ads2bibdesk requires 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:

The API key can be written into your ads2bibdesk preference file ~/.ads/ads2bibdesk.cfg (see the template). Following the Python/ads package’s instruction, one can also save the key to ~/.ads/dev_key or as an environment variable named ADS_DEV_KEY.

Credit to the contributors of the original ads_bibdesk @jonathansick @RuiPereira @keflavich for their initial implementation.

Quickstart

Installation

The command line script can be installed via:

pip install --user git+https://github.com/r-xue/ads2bibdesk.git # from GitHub
pip install --user ads2bibdesk                                  # from PyPI (likely behind the GitHub version)
pip install --user .                                            # from a local copy
pip install --user -e .                                         # from a local copy, "Editable" install

To have the macOS service (workflow) installed at the same time, run one of the following options instead:

pip install --user --install-option="--service" .               # from a local copy
pip install --user --install-option="--service" ads2bibdesk     # from PyPI

The option “–service” will copy the optional macOS workflow file Add to BibDesk.workflow to ~/Library/Services/, with an updated command-line script path specific for your installation.

Note:

  • Only Python >=3.7 is supported (see below).

  • 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 launch ads2bibdesk.

  • The macOS workflow is not working properly on macOS 10.14 Mojave and 10.15 Catalina (see this issue)

Usage

Add 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"

ads2bibdesk accepts three kinds of article identifier at this moment

  • ADS bibcode (e.g. 1998ApJ...500..525S, 2019arXiv190404507R)

  • arXiv id (e.g. 0911.4956).

  • doi (e.g. 10.3847/1538-4357/aafd37)

A full summary of ads2bibdesk commands is available via:

ads2bibdesk --help

Compatibility and Dependency

I’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 pip38

Status

The following functions have already been 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 links

  • use an authorized on-campus ssh proxy machine (with your public key) to download PDFs behind the journal paywall

  • add/update the BibDesk database and attach downloaded PDFs (largely borrowing the AppleScript method from the original ads_bibdesk)

Other changes from the original ads_bibdesk include:

  • clean up the dependency requirements

  • replace 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 program

Some less-used features from the original ads_bibdesk are gone: notably, the “ingest” and “preprint-update” modes. But I plan to at least add back the “preprint-update” option, by scanning/updating article_bibcode associated with arXiv). My improvement proposal can be found here.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ads2bibdesk-0.2.dev1.tar.gz (31.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ads2bibdesk-0.2.dev1-py3-none-any.whl (25.9 kB view details)

Uploaded Python 3

File details

Details for the file ads2bibdesk-0.2.dev1.tar.gz.

File metadata

  • Download URL: ads2bibdesk-0.2.dev1.tar.gz
  • Upload date:
  • Size: 31.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.3

File hashes

Hashes for ads2bibdesk-0.2.dev1.tar.gz
Algorithm Hash digest
SHA256 acda8230644f2be9caa4e99c1219e687e40692eb967eb5664b71cd46141f09dc
MD5 44dc7622da15299f6313fc861bab73f8
BLAKE2b-256 b44d4220c730ffb5177a5f2e933036fb38d6e164364463bc55aeadef041a8431

See more details on using hashes here.

File details

Details for the file ads2bibdesk-0.2.dev1-py3-none-any.whl.

File metadata

  • Download URL: ads2bibdesk-0.2.dev1-py3-none-any.whl
  • Upload date:
  • Size: 25.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.3

File hashes

Hashes for ads2bibdesk-0.2.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 a1ad481d717a5ef26fb0df58205e719e2a4168c8414812d60ed807f45361cb5e
MD5 c6940da8b49c9758f3b634ae1d050db5
BLAKE2b-256 b0749363982c8008d1983f7e47ca044f122ddb5e183a6f9e3d835031eb591950

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page