Test#
_BaseClient#
- class nasa.client._BaseClient[source]#
Bases:
objectThe base client class.
Note
This class is not available under the
nasanamespace since it isn’t meant to be used by users.- static _validate_date(date: str) datetime[source]#
Create a datetime object from a string used internally for date validation and str to date conversions
- Parameters:
date (
str) – The date to convert to adatetime.datetimeobject.- Raises:
ValueError – If the
dateisn’t in theYYYY-mm-dddate format.- Returns:
The converted
date.- Return type:
- static _date_to_str(date: datetime) str[source]#
Convert a datetime object into a string.
- Parameters:
date (
datetime.datetime) – Thedateto convert.- Returns:
The converted
date.- Return type:
- _date_validator(start_date: datetime.datetime | str, end_date: datetime.datetime | str | None) tuple[str, str | None][source]#
- Parameters:
start_date (Union[
datetime.datetime,str]) –end_date (Optional[Union[
datetime.datetime,str]]) –Raises –
- ValueError
If the parameters doesn’t follows the respectives types.
If the format of the date doesn’t follows the
YYYY-mm-dddate format.