Skip to content

API Reference

This page is auto-generated from Python docstrings.

datafun.app_case

app_case.py - Project script (example).

Author: Denise Case Date: 2026-01

Practice key Python skills: - pathlib for cross-platform paths - logging (preferred over print) - calling functions from modules - clear ETVL pipeline stages: E = Extract (read, get data from source into memory) T = Transform (process, change data in memory) V = Verify (check, validate data in memory) L = Load (write results, to data/processed or other destination)

Terminal command to run this file from the root project folder:

uv run python -m datafun.app_case
OBS

Don't edit this file - it should remain a working example. Copy it, rename it, and modify your copy.

main

main() -> None

Entry point for the script.

Entry point: run four simple ETVL pipelines.

log_header() logs a standard run header. log_path() logs repo-relative paths (privacy-safe).

Arguments: None. Returns: None.

Source code in src/datafun/app_case.py
def main() -> None:
    """Entry point for the script.

    Entry point: run four simple ETVL pipelines.

    log_header() logs a standard run header.
    log_path() logs repo-relative paths (privacy-safe).

    Arguments: None.
    Returns: None.
    """
    log_header(LOG, "P03")

    LOG.info("========================")
    LOG.info("START main()")
    LOG.info("========================")

    log_path(LOG, "ROOT_DIR", ROOT_DIR)
    log_path(LOG, "PROCESSED_DIR", PROCESSED_DIR)

    PROCESSED_DIR.mkdir(parents=True, exist_ok=True)

    # Call each pipeline. Each reads from data/raw and writes to data/processed.
    run_csv_pipeline(raw_dir=RAW_DIR, processed_dir=PROCESSED_DIR, logger=LOG)
    run_xlsx_pipeline(raw_dir=RAW_DIR, processed_dir=PROCESSED_DIR, logger=LOG)
    run_json_pipeline(raw_dir=RAW_DIR, processed_dir=PROCESSED_DIR, logger=LOG)
    run_text_pipeline(raw_dir=RAW_DIR, processed_dir=PROCESSED_DIR, logger=LOG)

    LOG.info("========================")
    LOG.info("Executed successfully!")
    LOG.info("========================")