Skip to main content
# adsquery

This tool let you query the ADS using a simple CLI.

## Installation
You'll need an API key from NASA ADS labs. Sign up for the newest version of ADS search at https://ui.adsabs.harvard.edu, visit account settings and generate a new API token. The official documentation is available at https://github.com/adsabs/adsabs-dev-api.

You can then install the tool through pip:
```
$ pip install adsquery
```

After that, you should be able to use it under the name `adsquery`:
```
$ adsquery --help
$ adsquery query --help
```

## Querying
To make a query to the ADS, try:
```
$ adsquery query [my-query]
```
The query can either be an ADS compatible query or a bashist one. For example:
```
$ adsquery query --first-author Einstein 1915
$ adsquery query ^Einstein 1915
```
will result in the same results (papers by Einstein in 1915).


## Examples
Imagine we're looking at the original 1915 Einstein's paper that's explaining for the first time the advance of the perihelion of Mercury. Here's an example of how to use adsquery
```
$ adsquery query --first-author Einstein --year 1915
[0]: 1915, Annalen der Physik — Einstein, A., Antwort auf eine Abhandlung M. v. Laues Ein Satz der Wahrscheinlichkeitsrechnung und seine Anwendung auf die Strahlungstheorie
[1]: 1915, Sitzungsberichte der Königlich Preußischen Akademie der Wissenschaften (Berlin — Einstein, Albert, Die Feldgleichungen der Gravitation
[2]: 1915, Naturwissenschaften — Einstein, A., Experimenteller Nachweis der Ampèreschen Molekularströme
[3]: 1915, Sitzungsber. preuss.Akad. Wiss — Einstein, A., Erklarung der Perihelionbewegung der Merkur aus der allgemeinen Relativitatstheorie
[4]: 1915, Sitzungsberichte der Königlich Preußischen Akademie der Wissenschaften (Berlin — Einstein, Albert, Erklärung der Perihelbewegung des Merkur aus der allgemeinen Relativitätstheorie
[5]: 1915, Sitzungsberichte der Königlich Preußischen Akademie der Wissenschaften (Berlin — Einstein, Albert, Zur allgemeinen Relativitätstheorie
[6]: 1915, Koninklijke Nederlandse Akademie van Wetenschappen Proceedings Series B Physical Sciences — Einstein, A., de Haas, W. J., Experimental proof of the existence of Ampère's molecular currents
[7]: 1915, Sitzungsberichte der Königlich Preußischen Akademie der Wissenschaften (Berlin — Einstein, Albert, Zur allgemeinen Relativitätstheorie (Nachtrag)
[8]: 1915, Deutsche Physikalische Gesellschaft — Einstein, Albert, de Haas, Wander Johannes, Notiz zu unserer Arbeit "Experimenteller Nachweis der Ampèreschen Molekularströme"
[9]: 1915, Deutsche Physikalische Gesellschaft — Einstein, Albert, Berichtigung zu meiner gemeinsam mit Herrn J. W. de Haas veröffentlichten Arbeit "Experimenteller Nachweis der Ampèreschen Molekularströme"
```
Here we see we got a few papers from the period, let's keep only the ones matching the work `Merkur` (Mercury in German)
```
Comma separated articles to download [e.g. 1-3, 4], [m] for more [q] to quit or add more parameters to request [e.g. year:2016]: Merkur
[0]: 1915, Sitzungsberichte der Königlich Preußischen Akademie der Wissenschaften (Berlin — Einstein, Albert, Erklärung der Perihelbewegung des Merkur aus der allgemeinen Relativitätstheorie

# Now let's download it
Comma separated articles to download [e.g. 1-3, 4], [m] for more [q] to quit or add more parameters to request [e.g. year:2016]: 0
Download [d], bibtex[b], quit[q]? d
```
The file is now located at `~/ADS/1915SPAW.......831E_Einstein.pdf`. If you wanted the bibtex entry, you should replace the last `d` by `b`.

# Features
- [x] query the ADS
- [x] interactively prompt the user
- [x] show bibtex reference
- [x] download pdf file

## Bugs and suggestions
Feel free to fill in an issue if you have any problem or suggestion

## Thanks
Special thanks to andycasey for providing https://github.com/andycasey/ads and the ADS!


Metadata

Release files for adsquery 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for adsquery 0.1.1
File Size Uploaded
adsquery-0.1.1.tar.gz 9.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for adsquery 0.1.1
File Interpreter ABI Platform
adsquery-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 20.7 kB

Release files / adsquery-0.1.1.tar.gz

Download URL adsquery-0.1.1.tar.gz
Size 9.8 kB
Tags Source
SHA-256 checksum
How to use checksums
5e879107e7060ed78027c93891ed3ad77e7a6d1ec5802e0485d046b254dfe1ef
BLAKE2b-256 checksum
How to use checksums
bc9fb851f0bc553a5fb5ab384872f19eb6b77d36e694d489a910bd5bab0e9a83
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / adsquery-0.1.1-py3-none-any.whl

Download URL adsquery-0.1.1-py3-none-any.whl
Size 10.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
165275c29dd9b0d01d51d5c736e1a7350caf88876fc574cf17d6c82fd7b9c226
BLAKE2b-256 checksum
How to use checksums
319d7dd51e26a175758964b7a2e3ba7144a6fec85e02d0a04df23b64ded59dee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

0.0.9

1 release file

0.0.8

1 release file

0.0.7

1 release file

0.0.6

1 release file

0.0.5

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page