Skip to content

Know when your source data changes

Build a dataset from published sources. Keep a record of each download, trace the outputs back to it, and check when the publisher changes the file.

uv tool install sourceledger

Python 3.12+ · Linux, macOS and Windows

From published bytes to a built dataset

  1. Published source
    annual.csv · declared in sources.toml
    2023 · 419.31 ppm
  2. Recorded download
    SHA-256 · first 12 characters
    943000a3ec89
  3. Built output
    data/processed/co2.csv
    Linked to the original download

A one-value change leaves a trail

Synthetic example · CO₂ concentration, ppm:

Year Original download After the revision
2022 417.06 417.06
2023 419.31 419.32

The original output passes validation. The publisher then changes 2023’s value from 419.31 to 419.32. After a fresh fetch, validation reports that the existing output needs rebuilding:

data/processed/co2.csv: rows come from an earlier fetch than co2.csv; re-run build
Read the recorded checksums

Original SHA-256: 943000a3ec89b4be3372b10e0f904c45cef4f9168aa728639e0eb7e9d2747505

Revised SHA-256: b5e4e235da3066bccd4bf836b9f823b45709fb5e06afdb2b5328210c62c796e5

Follow the complete example, or review the installation options.

Use sourceledger in your project

Use the manifest and command reference for your own sources.

If pooch, DVC, dlt or your own code already downloads your data, keep it and record each file. For scripts and CI, JSON reports provide structured status and validation results. If you received a dataset, you can verify its files offline.

See where sourceledger fits among other data tools before choosing it for your project.