unsprawl.loader¶
Data loading module for Unsprawl.
This module handles CSV ingestion and schema normalization for HDB resale data.
Classes¶
Module Contents¶
- class Schema[source]¶
Canonical column names expected by the pipeline.
This class centralizes schema expectations while allowing flexible mapping from real-world datasets where names may vary slightly in case or spacing.
- class HDBLoader(schema=None)[source]¶
Load and normalize HDB resale CSV data.
The loader focuses on robust file I/O and schema normalization. It lowercases and strips column names to mitigate schema drift and attempts to coerce core numeric columns into numeric dtype with proper NA handling.
- schema¶
- logger¶
- load(path)[source]¶
Load CSV into a pandas DataFrame with normalized column names.
- Parameters:
path (str) – Path to the CSV file.
- Returns:
DataFrame with normalized columns and raw types preserved where possible.
- Return type:
pd.DataFrame
- Raises:
FileNotFoundError – If the file does not exist.
ValueError – If the CSV cannot be parsed.