edmt.base¶
Submodules¶
Package Contents¶
- class edmt.base.AirdataBaseClass(api_key: str, skip_auth: bool = False)¶
- api_key¶
- base_url = 'api.airdata.com'¶
- authenticated = False¶
- auth_header¶
- authenticate(validate=True)¶
Authenticates with the API by calling /version or /flights.
- edmt.base.ExtractCSV(row: dict | pandas.Series, col: str, max_retries: int = 3, timeout: int = 15) pandas.DataFrame | None¶
Fetches a CSV file from a URL specified in a given column of a metadata record.
This function retrieves a CSV file from the URL found in the specified column (col) of the input row, parses it into a pandas DataFrame, and returns the result. It includes retry logic with exponential backoff to handle transient network errors.
- Parameters:
row (dict or pandas.Series) -- A metadata record containing a URL string in the column specified by col.
col (str) -- The key or column name in row that contains the URL to the CSV file.
max_retries (int, optional) -- Maximum number of retry attempts in case of failure. Defaults to 3.
timeout (int or float, optional) -- Timeout for each HTTP request in seconds. Defaults to 15 seconds.
- Returns:
A pandas DataFrame containing the parsed CSV data if successful.
None if the URL is missing, invalid, or if all retry attempts fail.
- Return type:
pandas.DataFrame or None
- Raises:
None --