speasy.core.direct_archive_downloader.direct_archive_downloader module

class speasy.core.direct_archive_downloader.direct_archive_downloader.RandomSplitDirectDownload[source]

Bases: object

static get_product(url_pattern: str, variable: str, start_time: str | datetime | float64 | float | datetime64, stop_time: str | datetime | float64 | float | datetime64, fname_regex: str, split_frequency: str = 'daily', **kwargs) SpeasyVariable | None[source]
static list_files(split_frequency, url_pattern: str, start_time: str | datetime | float64 | float | datetime64, stop_time: str | datetime | float64 | float | datetime64, fname_regex: str, **kwargs)[source]
static overlaps_range(range_start, range_stop, start, stop, version=None)[source]
class speasy.core.direct_archive_downloader.direct_archive_downloader.RegularSplitDirectDownload[source]

Bases: object

static get_product(url_pattern: str, variable: str, start_time: str | datetime | float64 | float | datetime64, stop_time: str | datetime | float64 | float | datetime64, use_file_list: bool = False, split_frequency: str = 'daily', **kwargs) SpeasyVariable | None[source]
speasy.core.direct_archive_downloader.direct_archive_downloader.get_product(url_pattern: str, split_rule: str, variable: str, start_time: str | datetime | float64 | float | datetime64, stop_time: str | datetime | float64 | float | datetime64, use_file_list: bool = False, **kwargs) SpeasyVariable | None[source]
speasy.core.direct_archive_downloader.direct_archive_downloader.spilt_range(split_frequency: str, start_time: str | datetime | float64 | float | datetime64, stop_time: str | datetime | float64 | float | datetime64)[source]

Given a split frequency (daily, yearly) and a time range, generate the list of start time of each fragment given a split frequency (daily, yearly) and a time range to split.

Parameters:
split_frequencystr

Fragments spilt frequency (daily, monthly, yearly)

start_timeAnyDateTimeType

Time range start

stop_timeAnyDateTimeType

Time range stop

Returns:
List[datetime]

Ordered list of start time of each fragment composing the given input range

Examples

>>> spilt_range('daily', "2018-01-02", "2018-01-03")
[datetime.datetime(2018, 1, 2, 0, 0, tzinfo=datetime.timezone.utc), datetime.datetime(2018, 1, 3, 0, 0, tzinfo=datetime.timezone.utc)]