Skip to content

betting_combat.rounds.identity.live

The card run’s ids before a card: its event’s event_uid, a debutant’s fighter_uid and each bout’s bout_uid with its facts, minted when the card is assembled (services.rounds_upcoming) and stored with the registry, so each keeps ONE id from the card run to the training rows: when UFCStats lists the card, build.extend binds its fight ids to the live bouts (the same two fighters within a day), its event to the live event, and its spellings to the live fighters.

live_event the card's event: the live event already minted for the date (within a
day) under the same Wikipedia page, else a new one with that key
live_fighter a fighter the registry does not hold: minted ('live'), with the card's
keys for him (his Kalshi competitor id, the spellings); a key bound to
another fighter refuses the mint (``IdentityError``)
live_bout the bout of two fighter_uids at the event: the live bout already minted for
them within a day (a card assembled again keeps its ids; its facts must be
the same, else ``IdentityError``: the card is not traded on other facts),
else a new one with its facts; fighter A by the registry's hash
bind_bout a source's key for a bout (the Kalshi winner event the card linked it to,
Cito's bout id); a key already bound to another bout refuses
(``IdentityError``)
bind_fighter a source's key for a fighter we hold (Cito's fighter id; Kalshi's second
id for him when Cito's id says it is him); bound elsewhere: refused
bind_event a source's key for an event (Cito's event slug); bound elsewhere: refused

Functions

bind_bout

bind_bout(identity: Identity, source: str, key: str, bout_uid: str, how: str) -> Identity

identity with source’s key for the bout (see the module doc).

bind_event

bind_event(identity: Identity, source: str, key: str, event_uid: str, how: str) -> Identity

identity with source’s key for the event (see the module doc).

bind_fighter

bind_fighter(identity: Identity, source: str, key: str, fighter_uid: str, how: str) -> Identity

identity with source’s key for the fighter (see the module doc).

live_bout

live_bout(identity: Identity, card_date: dt.date, fighter_x: str, fighter_y: str, event_uid: str, facts: dict[str, Any]) -> tuple[Identity, str]

identity with the live bout of the two fighters at event_uid on card_date with its facts (rounds, division, women, title; see the module doc), and its bout_uid.

live_event

live_event(identity: Identity, card_date: dt.date, name: str, location: str, page: str | None) -> tuple[Identity, str]

identity with the card’s live event (see the module doc), and its event_uid.

live_fighter

live_fighter(identity: Identity, name: str, keys: Sequence[tuple[str, str]] = ()) -> tuple[Identity, str]

identity with a new ‘live’ fighter name and his keys ((source, key); names are normalised, the name itself always one), and his fighter_uid.

merge_fighters

merge_fighters(identity: Identity, from_uid: str, into_uid: str, evidence: str) -> Identity

identity with the reviewed correction that from_uid IS into_uid (the card run minted him for a name of a fighter we know). Only a fighter without a UFCStats page may be merged away; never into himself, never twice (IdentityError).