compare_metadata()

Diff the metadata (D_*.TXT) files between two quarter directories.

Usage

Source

compare_metadata(
    dir1,
    dir2,
)

Parameters

dir1: str | Path

Paths to directories produced by download_data().

dir2: str | Path
Paths to directories produced by download_data().

Returns

A dict with two keys:
"file_differences"

Sub-dict describing count/name/order differences:

  • "only_in_dir1" - filenames present in dir1 but not dir2
  • "only_in_dir2" - filenames present in dir2 but not dir1
  • "order_different" - True if the shared files appear in a different order across the two directories
"content_differences"
Dict keyed by filename (shared files only). Each value is a list of unified-diff lines for files that differ; files with identical content are omitted.