Skip to content

Commit c4b63c5

Browse files
committed
added some docs and one test (my first test ever!).
1 parent ec0d89e commit c4b63c5

File tree

2 files changed

+25
-4
lines changed

2 files changed

+25
-4
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from ... import nasa_ads
2+
3+
def test_simple(patch_post):
4+
x = nasa_ads.ADS.query_simple('^Persson Origin of water around deeply embedded low-mass protostars')
5+
assert x[-1]['authors'][0] == 'Persson, M. V.'

docs/nasa_ads/nasa_ads.rst

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,42 @@ Getting Started
1010
===============
1111

1212
This module provides an interface to the online `SAO/NASA Astrophysics Data System`_.
13+
At the moment only the "simple search", i.e. omni-box search is available, and only
14+
a subset of the results are accessible.
1315

1416
Examples
1517
========
1618

17-
1819
Search works by specific identifier
1920
-----------------------------------
2021

22+
from astroquery import nasa_ads as na
23+
# the "^" makes ADS to return only papers where Persson
24+
# is first author
25+
results = na.ADS.query_simple('^Persson Origin of water\
26+
around deeply embedded low-mass protostars') results[0].title
27+
28+
# to sort after publication date
29+
results.sort(['pubdate'])
30+
31+
# get the title of the last hit
32+
title = results[-1]['title'][0]
33+
34+
# printout the authors of the last hit
35+
print results[-1]['authors']
36+
2137

2238
Get links
2339
---------
24-
40+
Not yet implemented.
2541

2642
Download publisher/ArXiv PDF
2743
----------------------------
28-
44+
Not yet implemented.
2945

3046
Get Bibtex
3147
----------
32-
48+
Not yet implemented.
3349

3450

3551

0 commit comments

Comments
 (0)