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 meteor trajectory file urls from the GMN Data Directory. |
|
Get all monthly meteor trajectory file urls from the GMN Data Directory. |
|
Get the URL of the meteor trajectory file containing all data. |
|
|
Get the URL of the daily meteor trajectory file for a given date. |
|
Get the URL of the monthly meteor trajectory file for a given month. |
|
Get the content of a meteor trajectory file from a given URL. |
|
Get the content of the daily meteo trajectory file for a given date. |
|
Get the content of the monthly meteor trajectory file for a given date. |
Get the content of the meteor trajectory file containing all data. |
|
|
Get all paths from a directory listing URL. |
Attributes#
The base URL for meteor trajectory files in the GMN Data Directory. |
|
The date of the earliest meteor trajectory file in the GMN Data Directory. |
|
The name of the directory containing daily meteor trajectory files in the base |
|
The name of the directory containing monthly meteor trajectory files in the base |
|
The extension of the meteor trajectory files in the GMN Data Directory |
|
The filename of the most recent meteor trajectory file. |
|
The filename of the meteo trajectory file from yesterday. |
|
The filename of the meteor trajectory file containing all data. |
|
The daily string date format that should be passed in as a parameter to the |
|
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]