pyastroapi.search

Module Contents

Functions

search(query[, limit, fields, dbg])

Performs an ADS search

first_author(author[, limit, fields, dbg])

Performs an ads search equivalent to: ^author

author_year(author, year[, limit, fields, dbg])

Performs an ads search equivalent to: ^author year:year

orcid(orcid[, limit, fields, dbg])

Performs an ads search equivalent to: orcid:orcid

bibcode(bibcode[, limit, fields, dbg])

Searches for a given bibcode

citations(bibcode[, limit, fields, dbg])

Gets citations to paper given by bibcode

references(bibcode[, limit, fields, dbg])

Get the papers referenced by paper given by bibcode

astro_ph([limit, fields, dbg])

Gets the previous (working) days Arxiv postings

pyastroapi.search.search(query: str, limit: int = -1, fields: List[str] = None, dbg: bool = False)

Performs an ADS search

Parameters:
  • query (str) – Search query

  • limit (int, optional) – Number of rows to limit to (-1 is no limit). Defaults to -1.

  • fields (t.List[str], optional) – ADS fields to return, if None returns a default set of fields.

  • dbg (bool, optional) – Debugging flag. Defaults to False.

Returns:

Returns a generator where each element is a dict for each ADS record, with keys given by the fields

Return type:

generator

pyastroapi.search.first_author(author: str, limit: int = -1, fields: List[str] = None, dbg: bool = False)

Performs an ads search equivalent to: ^author

Parameters:
  • author (str) – Author to search for

  • limit (int, optional) – Number of rows to limit to (-1 is no limit). Defaults to -1.

  • fields (t.List[str], optional) – ADS fields to return, if None returns a default set of fields.

  • dbg (bool, optional) – Debugging flag. Defaults to False.

Returns:

Returns a generator where each element is a dict for each ADS record, with keys given by the fields

Return type:

generator

pyastroapi.search.author_year(author, year, limit: int = -1, fields: List[str] = None, dbg: bool = False)

Performs an ads search equivalent to: ^author year:year

Parameters:
  • author (str) – Author to search for

  • year (int) – Year to limit to

  • limit (int, optional) – Number of rows to limit to (-1 is no limit). Defaults to -1.

  • fields (t.List[str], optional) – ADS fields to return, if None returns a default set of fields.

  • dbg (bool, optional) – Debugging flag. Defaults to False.

Returns:

Returns a generator where each element is a dict for each ADS record, with keys given by the fields

Return type:

generator

pyastroapi.search.orcid(orcid: str, limit: int = -1, fields: List[str] = None, dbg: bool = False)

Performs an ads search equivalent to: orcid:orcid

Parameters:
  • orcid (str) – ORCID

  • limit (int, optional) – Number of rows to limit to (-1 is no limit). Defaults to -1.

  • fields (t.List[str], optional) – ADS fields to return, if None returns a default set of fields.

  • dbg (bool, optional) – Debugging flag. Defaults to False.

Returns:

Returns a generator where each element is a dict for each ADS record, with keys given by the fields

Return type:

generator

pyastroapi.search.bibcode(bibcode: str, limit: int = -1, fields: List[str] = None, dbg: bool = False)

Searches for a given bibcode

Parameters:
  • bibcode (str) – Bibcode

  • limit (int, optional) – Number of rows to limit to (-1 is no limit). Defaults to -1.

  • fields (t.List[str], optional) – ADS fields to return, if None returns a default set of fields.

  • dbg (bool, optional) – Debugging flag. Defaults to False.

Returns:

Returns a generator where each element is a dict for each ADS record, with keys given by the fields

Return type:

generator

pyastroapi.search.citations(bibcode: str, limit: int = -1, fields: List[str] = None, dbg: bool = False)

Gets citations to paper given by bibcode

Parameters:
  • bibcode (str) – Bibcode

  • limit (int, optional) – Number of rows to limit to (-1 is no limit). Defaults to -1.

  • fields (t.List[str], optional) – ADS fields to return, if None returns a default set of fields.

  • dbg (bool, optional) – Debugging flag. Defaults to False.

Returns:

Returns a generator where each element is a dict for each ADS record, with keys given by the fields

Return type:

generator

pyastroapi.search.references(bibcode: str, limit: int = -1, fields: List[str] = None, dbg: bool = False)

Get the papers referenced by paper given by bibcode

Args:

bibcode (str): Bibcode limit (int, optional): Number of rows to limit to (-1 is no limit). Defaults to -1. fields (t.List[str], optional): ADS fields to return, if None returns a default set of fields. dbg (bool, optional): Debugging flag. Defaults to False.

Returns:

Returns a generator where each element is a dict for each ADS record, with keys given by the fields

Return type:

generator

pyastroapi.search.astro_ph(limit: int = -1, fields: List[str] = None, dbg: bool = False)

Gets the previous (working) days Arxiv postings

Parameters:
  • limit (int, optional) – Number of rows to limit to (-1 is no limit). Defaults to -1.

  • fields (t.List[str], optional) – ADS fields to return, if None returns a default set of fields.

  • dbg (bool, optional) – Debugging flag. Defaults to False.

Returns:

Returns a generator where each element is a dict for each ADS record, with keys given by the fields

Return type:

generator