Skip to main content
Version: 0.0.98

ts_shape.loader.timeseries.s3proxy_parquet_loader

Classes
NameDescription
S3ProxyDataAccessA class to access timeseries data via an S3 proxy. This class retrieves

S3ProxyDataAccess​

classsource
S3ProxyDataAccess(
start: str, end: str, uuids: list[str], s3_config: dict[str, str]
)

A class to access timeseries data via an S3 proxy. This class retrieves data for specified UUIDs within a defined time range, with the option to output data as Parquet files or as a single combined DataFrame.

Functions
NameDescription
fetch_data_as_parquetRetrieve timeseries data from S3 and save it as Parquet files.
fetch_data_as_dataframeRetrieve timeseries data from S3 and return it as a single DataFrame.
Parameters
NameTypeDescriptionDefault
startstrStart timestamp in "Year-Month-Day Hour:Minute:Second" format.required
endstrEnd timestamp in "Year-Month-Day Hour:Minute:Second" format.required
uuidslist[str]List of UUIDs to retrieve data for.required
s3_configdict[str, str]Configuration dictionary for the S3 connection. Must contain endpoint_url, key, secret, use_ssl, version_aware and s3_path_base.required

fetch_data_as_parquet​

methodsource
fetch_data_as_parquet(output_dir: str) -> None

Retrieve timeseries data from S3 and save it as Parquet files.

Each file is saved as <output_dir>/year/month/day/hour/<uuid>.parquet, with only the rows whose systime lies in [start, end] (a file left with no rows is not written).

Parameters
NameTypeDescriptionDefault
output_dirstrBase directory to save the Parquet files.required

fetch_data_as_dataframe​

methodsource
fetch_data_as_dataframe() -> pd.DataFrame

Retrieve timeseries data from S3 and return it as a single DataFrame.

Hour folders are read in full; rows whose systime falls outside [start, end] (both inclusive) are then dropped.

Returns
TypeDescription
DataFrameA combined DataFrame with data for all specified UUIDs and time
DataFrameslots; an empty long-format frame (see
DataFramefunc:~ts_shape.loader._utils.empty_signal_frame) when no file
DataFramewas found.