Skip to content

betting_combat.providers.bestfightodds.archive

archive.py — BestFightOdds’ old card pages as the web archive (web.archive.org) keeps them. Today’s pages list today’s books only, so a card before 2021 shows no book’s line; the archive’s copies of its page show the books of the time and every prop, each a book’s last line before the card when the copy was taken after it.

parse_cdx the archive's listing (CDX, ``original timestamp status``): every copy of an
event page, by BFO's event id (a page's words change, its id never does)
Snapshot one copy: BFO's event id, its page, when the archive took it (UTC)
BfoArchive the provider: ``snapshots(start, end)`` the copies taken in those years,
``page(snapshot)`` a copy's raw page (the archive's own banner left out), one
request every ``ARCHIVE_DELAY_S``; an archive outage (its "Temporarily Offline"
page) waits and asks again

A copy is read the way parse_event reads today’s pages.

Classes

BfoArchive

Bases: Provider

The web archive’s copies of BestFightOdds’ event pages.

page

page(snap: Snapshot) -> str

The copy’s page as BFO served it then (id_: without the archive’s banner).

snapshots

snapshots(start: int = 2008, end: int = 2022) -> list[Snapshot]

Every copy of an event page the archive took in years start .. end.

Snapshot

One archived copy of an event page.

Functions

parse_cdx

parse_cdx(text: str) -> list[Snapshot]

The listing’s event-page copies that answered 200 (original timestamp status lines).