AtAnyRate/src/models.py
ilia 1a7298f755 Initial commit: EventRate pipeline, fuzzy dedup, Airbnb retries
Wire up Ticketmaster, SeatGeek, Telegram, scoring, Playwright stubs.
Deduplicate events with fuzzy venue/name matching. Retry calendar
updates on transient failures. Backlog tasks marked complete.

Made-with: Cursor
2026-04-04 12:31:53 -04:00

28 lines
720 B
Python

"""Normalized event model shared across all providers."""
from __future__ import annotations
from dataclasses import dataclass, field
from datetime import date
from typing import Any
@dataclass(frozen=True)
class NormalizedEvent:
name: str
event_date: date
venue: str
source: str
url: str = ""
score: float = 0.0
raw: dict[str, Any] = field(default_factory=dict, repr=False, compare=False)
@property
def dedup_key(self) -> str:
"""Key used for cross-provider deduplication.
Combines date and lowercased venue. Fuzzy name matching
may be layered on top in dedup.py.
"""
return f"{self.event_date.isoformat()}|{self.venue.lower().strip()}"