pyastroapi
Low level library interfacing with NASA's ADSABS api
Science Score: 44.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (18.5%) to scientific vocabulary
Repository
Low level library interfacing with NASA's ADSABS api
Basic Info
- Host: GitHub
- Owner: rjfarmer
- License: bsd-3-clause
- Language: Python
- Default Branch: main
- Size: 1.18 MB
Statistics
- Stars: 6
- Watchers: 3
- Forks: 1
- Open Issues: 0
- Releases: 2
Metadata Files
README.md
pyAstroApi
Low level library interfacing with NASA's ADSABS api.
Installation
PyPi
pip install pyAstroApi
From source
Install dependencies:
bash
pip install -r requirements.txt
Build and install software
bash
pip install .
Testing locally
Install dependencies:
bash
pip install -r requirements_dev.txt
and then to run with one python version
bash
pytest
or use tox to test multiple versions of python
bash
tox
Getting started
Full documentation can be found at readthedocs.
Here is a quick start guide for the very basics.
ADS Key
First you will need your own ADS api key: https://ui.adsabs.harvard.edu/user/settings/token
This can be saved to the file:
bash
~/.ads/dev_key
Basic searching
To quickly just search and get a set of papers back from ADS:
````python import pyastroapi.articles
a = articles.journal(search="^farmer year:2020") ````
The search field can be any standard ADS query. The object a is now a journal which is a dict-like object of article's.
You can also constrcut a journal from a list of bibcodes:
python
a = articles.journal(bibcodes=["2020ApJ...902L..36F","2021ApJ...923..214F"])
A journal can be accessed either by specifying the bibcode:
python
paper = a["2020ApJ...902L..36F"]
or iterated over like a list (or accessed with an index, e.g., a[0])
python
for paper in a:
print(paper.title)
The object paper is an article which encapsulates all the methods needed to access the information ADS has on a paper. The initial search (Either via access through a journal or by creating an article with: articles.article("2020ApJ...902L..36F")) will fetch a set of standard fields from ADS.
Non-standard fields will require additional fetch's to ADS servers, but this is wrapped so all you need to do is try to access the field and the data will be fetched for you.
Most fields can be accessed as properties:
python
paper.title
paper.author
paper.abstract
Though some fields are function calls:
python
paper.citations()
paper.references()
Extra information
An article also contains wrappers into some of the other ADS features:
python
paper.url.journal()
Get the publisher HTML url
python
paper.pdf.arxiv()
Download the Arxiv pdf to a file given by the papers bibcode (e.g., 2020ApJ...902L..36F.pdf)
python
paper.export.bibtex()
Get the papers BibTex
python
paper.metrics.histograms()
Return a histogram of the metric data for the paper
python
paper.visual.author()
Return the author network visualization for the paper.
API
Functions and classes inside the pyastroapi namespace are provided to provide convenient wrappers around the output of ADSABS API. Though at this time not ever endpoint has a wrapper.
However, the pyastroapi.api namespace provides a low-level API that handles setting all the arguments necessary for each of the API end points.
List of the ADSABS API's are currently implemented inside the pyastroapi.api namespace
- [X] Search (Including big queries)
- [X] Stored Search
- [X] Libraries (apart from editing an existing library)
- [X] Export
- [X] Metrics
- [X] Author Affiliation
- [X] Citation Helper
- [X] Classic import (Caveat: I don't have a classic account to test with)
- [X] Objects
- [X] Recommender (Except matchdoc)
- [X] Reference
- [X] Notifications
- [X] Visualizations
Contributing
Contributions are welcome either as pull requests or as bug reports. If reporting a bug please include the exact code you used and if applicable the bibcodes for any paper you where trying to access.
Acknowledgements
This project is not affiliated with NASA or ADSABS.
This research has made use of NASA’s Astrophysics Data System Bibliographic Services.
Owner
- Name: Robert Farmer
- Login: rjfarmer
- Kind: user
- Location: Germany
- Website: http://rjfarmer.io
- Repositories: 7
- Profile: https://github.com/rjfarmer
Citation (CITATION.cff)
# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!
cff-version: 1.2.0
title: pyAstroApi
message: >-
If you use this software, please cite it using the
metadata from this file.
type: software
authors:
- given-names: Robert
family-names: Farmer
email: robert.j.farmer37@gmail.com
orcid: 'https://orcid.org/0000-0003-3441-7624'
identifiers:
- type: doi
value: 10.5281/zenodo.6998527
description: Zenodo
repository-code: 'https://github.com/rjfarmer/pyAstroApi'
url: 'https://pyastroapi.readthedocs.io/'
repository-artifact: 'https://pypi.org/project/pyastroapi/'
license: BSD-3-Clause
GitHub Events
Total
Last Year
Issues and Pull Requests
Last synced: 11 months ago
All Time
- Total issues: 1
- Total pull requests: 1
- Average time to close issues: 2 days
- Average time to close pull requests: 1 day
- Total issue authors: 1
- Total pull request authors: 1
- Average comments per issue: 0.0
- Average comments per pull request: 1.0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 1
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- rjfarmer (1)
Pull Request Authors
- dependabot[bot] (2)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 14 last-month
- Total dependent packages: 0
- Total dependent repositories: 1
- Total versions: 5
- Total maintainers: 1
pypi.org: pyastroapi
"Low level library interfacing with NASA's ADSABS api"
- Homepage: https://github.com/rjfarmer/pyAstroApi
- Documentation: https://pyastroapi.readthedocs.io/
- License: BSD 3-Clause License
-
Latest release: 2.0.4
published over 3 years ago
Rankings
Maintainers (1)
Dependencies
- actions/checkout master composite
- actions/setup-python master composite
- codecov/codecov-action v3 composite
- actions/checkout master composite
- actions/setup-python v1 composite
- pypa/gh-action-pypi-publish release/v1 composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- sphinx *
- sphinx-autoapi *
- bibtexparser *
- feedparser *
- requests *
- setuptools_scm *