gmn_python_api.data_directory#

This module contains functions to read meteor trajectory files from the GMN Data

Directory.

Module Contents#

Functions#

get_all_daily_file_urls()

Get all daily meteor trajectory file urls from the GMN Data Directory.

get_all_monthly_file_urls()

Get all monthly meteor trajectory file urls from the GMN Data Directory.

get_all_file_url()

Get the URL of the meteor trajectory file containing all data.

get_daily_file_url_by_date(date_str[, current_date])

Get the URL of the daily meteor trajectory file for a given date.

get_monthly_file_url_by_month(date_str)

Get the URL of the monthly meteor trajectory file for a given month.

get_file_content_from_url(file_url)

Get the content of a meteor trajectory file from a given URL.

get_daily_file_content_by_date(date_str[, current_date])

Get the content of the daily meteo trajectory file for a given date.

get_monthly_file_content_by_date(date_str)

Get the content of the monthly meteor trajectory file for a given date.

get_all_file_content()

Get the content of the meteor trajectory file containing all data.

_get_url_paths(url[, ext])

Get all paths from a directory listing URL.

Attributes#

BASE_URL

The base URL for meteor trajectory files in the GMN Data Directory.

DATA_START_DATE

The date of the earliest meteor trajectory file in the GMN Data Directory.

DAILY_DIRECTORY

The name of the directory containing daily meteor trajectory files in the base

MONTHLY_DIRECTORY

The name of the directory containing monthly meteor trajectory files in the base

SUMMARY_FILE_EXTENSION

The extension of the meteor trajectory files in the GMN Data Directory

SUMMARY_TODAY_FILENAME

The filename of the most recent meteor trajectory file.

SUMMARY_YESTERDAY_FILENAME

The filename of the meteo trajectory file from yesterday.

SUMMARY_ALL_FILENAME

The filename of the meteor trajectory file containing all data.

DAILY_DATE_INPUT_FORMAT

The daily string date format that should be passed in as a parameter to the

MONTHLY_DATE_INPUT_FORMAT

The monthly string date format that should be passed in as a parameter to the

gmn_python_api.data_directory.BASE_URL: str = 'https://globalmeteornetwork.org/data/traj_summary_data/'#

The base URL for meteor trajectory files in the GMN Data Directory.

gmn_python_api.data_directory.DATA_START_DATE: datetime.date#

The date of the earliest meteor trajectory file in the GMN Data Directory.

gmn_python_api.data_directory.DAILY_DIRECTORY: str = 'daily/'#

The name of the directory containing daily meteor trajectory files in the base URL.

gmn_python_api.data_directory.MONTHLY_DIRECTORY: str = 'monthly/'#

The name of the directory containing monthly meteor trajectory files in the base URL.

gmn_python_api.data_directory.SUMMARY_FILE_EXTENSION: str = 'txt'#

The extension of the meteor trajectory files in the GMN Data Directory

gmn_python_api.data_directory.SUMMARY_TODAY_FILENAME: str = 'traj_summary_latest_daily.txt'#

The filename of the most recent meteor trajectory file.

gmn_python_api.data_directory.SUMMARY_YESTERDAY_FILENAME: str = 'traj_summary_yesterday.txt'#

The filename of the meteo trajectory file from yesterday.

gmn_python_api.data_directory.SUMMARY_ALL_FILENAME: str = 'traj_summary_all.txt'#

The filename of the meteor trajectory file containing all data.

gmn_python_api.data_directory.DAILY_DATE_INPUT_FORMAT: str = '%Y-%m-%d'#

The daily string date format that should be passed in as a parameter to the functions in this module.

gmn_python_api.data_directory.MONTHLY_DATE_INPUT_FORMAT: str = '%Y-%m'#

The monthly string date format that should be passed in as a parameter to the functions in this module.

gmn_python_api.data_directory.get_all_daily_file_urls()#

Get all daily meteor trajectory file urls from the GMN Data Directory.

Returns:

A list of all daily file urls.

Raises:

requests.HTTPError if the data directory url doesn’t return a 200 response.

Return type:

List[str]

gmn_python_api.data_directory.get_all_monthly_file_urls()#

Get all monthly meteor trajectory file urls from the GMN Data Directory.

Returns:

A list of all monthly file urls.

Raises:

requests.HTTPError if the data directory url doesn’t return a 200 response.

Return type:

List[str]

gmn_python_api.data_directory.get_all_file_url()#

Get the URL of the meteor trajectory file containing all data.

Returns:

The URL of the file containing all data.

Return type:

str

gmn_python_api.data_directory.get_daily_file_url_by_date(date_str, current_date=None)#

Get the URL of the daily meteor trajectory file for a given date.

Parameters:
  • date_str (str) – The date of the daily file to get in the format YYYY-MM-DD.

  • current_date (Optional[get_daily_file_url_by_date.date]) – The current date. Defaults to datetime.now().

Returns:

The URL of the daily file.

Raises:

FileNotFoundError if the daily file cannot be found. Or requests.HTTPError is raised if the file url doesn’t return a 200 response.

Return type:

str

gmn_python_api.data_directory.get_monthly_file_url_by_month(date_str)#

Get the URL of the monthly meteor trajectory file for a given month.

Parameters:

date_str (str) – The date of the monthly file to get in the format YYYY-MM.

Returns:

The URL of the monthly file.

Raises:

FileNotFoundError if the monthly file cannot be found. Or requests.HTTPError is raised if the file url doesn’t return a 200 response.

Return type:

str

gmn_python_api.data_directory.get_file_content_from_url(file_url)#

Get the content of a meteor trajectory file from a given URL.

Parameters:
  • url – The URL of the meteor trajectory file.

  • file_url (str) –

Returns:

The content of the file.

Raises:

requests.HTTPError If the file url doesn’t return a 200 response.

Return type:

str

gmn_python_api.data_directory.get_daily_file_content_by_date(date_str, current_date=None)#

Get the content of the daily meteo trajectory file for a given date.

Parameters:
  • date_str (str) – The date of the daily file to get in the format YYYY-MM-DD.

  • current_date (Optional[datetime.date]) – The current date. Defaults to datetime.now().

Returns:

The content of the daily file.

Raises:

requests.HTTPError if the data directory url doesn’t return a 200 response.

Return type:

str

gmn_python_api.data_directory.get_monthly_file_content_by_date(date_str)#

Get the content of the monthly meteor trajectory file for a given date.

Parameters:

date_str (str) – The date to get the monthly file for in the format YYYY-MM.

Returns:

The content of the monthly file.

Raises:

requests.HTTPError if the data directory url doesn’t return a 200 response.

Return type:

str

gmn_python_api.data_directory.get_all_file_content()#

Get the content of the meteor trajectory file containing all data.

Returns:

The content of the file containing all data.

Raises:

requests.HTTPError if the data directory url doesn’t return a 200 response.

Return type:

str

gmn_python_api.data_directory._get_url_paths(url, ext='')#

Get all paths from a directory listing URL.

Parameters:
  • url (str) – The URL to get the paths from.

  • ext (str) – The extension to filter by.

Returns:

A list of all paths.

Raises:

requests.HTTPError if the URL doesn’t return a 200 response.

Return type:

List[str]