Diffing daily JSON snapshots in Python: added, removed and changed records, and three traps
The author maintains a daily archive of public datasets, including a German federal tender RSS feed, DeFiLlama endpoints, BaFin feeds and the MCP Registry, stored as gzipped JSON files. They built a Python script, snapshot_diff.py, that compares two snapshots by a chosen key and reports added, removed, changed and top-ranked numeric movements. Its core uses set operations on keys, excludes the numeric field from change detection, and ranks value shifts with a minimum-base filter. A sample run on a windowed RSS feed showed 77 'removed' tenders, which the author attributes to a fixed 100-item window rather than withdrawals. The post warns that windowed sources should be read as 'no longer visible' and that busy periods can cause permanent gaps unless collection is more frequent or paginated.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in