f1verse
f1verse · Python

How do I detect that an F1 result changed after publication?

Persist race.snapshot() and compare it later with f1verse.diff(before, after). You get a field-level list of what the source rewrote — the input to a correction notice.

>>> before = race.snapshot()          # hashed, comparable, JSON
>>> after = race.refresh().snapshot()
>>> f1verse.diff(before, after)
{'changed': True,
 'changes': [{'abbr': 'HAM', 'field': 'position', 'before': 4, 'after': None},
             {'abbr': 'HAM', 'field': 'gap', 'before': '+8.1s', 'after': 'DSQ'}]}

Every change to a cached body is journalled: f1verse.revisions() lists every source rewrite this install has observed, and f1verse.vintage(record) returns the superseded body when it was small enough to keep.

There is deliberately no as_of= time travel. f1verse can tell you what it sees now and when it saw a value change; it cannot reconstruct a value nobody here ever fetched.

Related