api_24sea.datasignals.responses#

Shared response assembly for DataSignals client facades.

Functions#

data_request_headers(→ Dict[str, str])

Prefer Parquet for data retrieval while honoring an explicit Accept.

parse_data_response(→ pandas.DataFrame)

Decode JSON or Parquet using the DataSignals non-null metric contract.

collapse_timestamp_rows(→ pandas.DataFrame)

Collapse repeated timestamp rows using the first non-null values.

merge_data_frames(→ pandas.DataFrame)

Merge split DataSignals responses in deterministic query order.

Module Contents#

data_request_headers(headers: Dict[str, str] | None, response_format: str) → Dict[str, str]#

Prefer Parquet for data retrieval while honoring an explicit Accept.

parse_data_response(response: httpx.Response, outer_join_on_timestamp: bool = False) → pandas.DataFrame#

Decode JSON or Parquet using the DataSignals non-null metric contract.

Parquet’s union schema fills absent metrics with nulls. The JSON endpoint omits null metrics and metadata-only rows, so apply the same rules here. Nested Arrow values are converted to Python lists and dictionaries.

collapse_timestamp_rows(data: pandas.DataFrame, index_column: str = 'timestamp') → pandas.DataFrame#

Collapse repeated timestamp rows using the first non-null values.

merge_data_frames(data_frames: List[pandas.DataFrame], outer_join_on_timestamp: bool) → pandas.DataFrame#

Merge split DataSignals responses in deterministic query order.