nokey.spaceflight package
Submodules
nokey.spaceflight.spaceflight_news module
- class nokey.spaceflight.spaceflight_news.SpaceflightNews(use_caching=False, cache_name='spaceflight_news_cache', backend='sqlite', expire_after=3600)[source]
Bases:
objectA class to interact with the Spaceflight News API.
- base_url
The base URL of the Spaceflight News API.
- about
A short description of the API.
- get_article_by_id(ID)[source]
Returns a specific article.
- Parameters:
ID (int) – A unique integer value identifying this article.
- Returns:
A dictionary containing the article.
- Return type:
dict
- get_articles(limit=10, offset=10, search=None, summary_contains=None, title_contains=None)[source]
Returns a list of spaceflight articles fitting the given parameters.
- Parameters:
limit (int) – Number of results to return per page. Defaults to 10.
offset (int) – The initial index from which to return the results. Defaults to 10.
search (str) – Search for documents with a specific phrase in the title or summary. Defaults to None.
summary_contains (str) – Search for all documents with a specific phrase in the summary. Defaults to None.
title_contains (str) – Search for all documents with a specific phrase in the title. Defaults to None.
- Returns:
List of spaceflight articles matching the given parameters.
- Return type:
dict
- get_blog_by_id(ID)[source]
Returns a specific blog.
- Parameters:
ID (int) – A unique integer value identifying this blog.
- Returns:
A dictionary containing the blog.
- Return type:
dict
- get_blogs(limit=10, offset=10, search=None, summary_contains=None, title_contains=None)[source]
Returns a list of spaceflight blogs fitting the given parameters.
- Parameters:
limit (int) – Number of results to return per page. Defaults to 10.
offset (int) – The initial index from which to return the results. Defaults to 10.
search (str) – Search for documents with a specific phrase in the title or summary. Defaults to None.
summary_contains (str) – Search for all documents with a specific phrase in the summary. Defaults to None.
title_contains (str) – Search for all documents with a specific phrase in the title. Defaults to None.
- Returns:
List of spaceflight blogs matching the given parameters.
- Return type:
dict
- get_docs_url()[source]
Returns the url for the Spaceflight News API documentation.
- Parameters:
None –
- Returns:
URL for API documentation.
- Return type:
string
- get_info()[source]
Returns information containing API version and news sites featured.
- Parameters:
None –
- Returns:
A dictionary containing the version number and a list of features news sites.
- Return type:
dict
- get_report_by_id(ID)[source]
Returns a specific report.
- Parameters:
ID (int) – A unique integer value identifying this report.
- Returns:
A dictionary containing the report.
- Return type:
dict
- get_reports(limit=10, offset=10, search=None, summary_contains=None, title_contains=None)[source]
Returns a list of spaceflight reports fitting the given parameters.
- Parameters:
limit (int) – Number of results to return per page. Defaults to 10.
offset (int) – The initial index from which to return the results. Defaults to 10.
search (str) – Search for documents with a specific phrase in the title or summary. Defaults to None.
summary_contains (str) – Search for all documents with a specific phrase in the summary. Defaults to None.
title_contains (str) – Search for all documents with a specific phrase in the title. Defaults to None.
- Returns:
List of spaceflight reports matching the given parameters.
- Return type:
dict