new-site/scripts/workers/cdr_adapters/__init__.py
justin f8cd37ac8c Initial commit — Performance West telecom compliance platform
Includes: API (Express/TypeScript), Astro site, Python workers,
document generators, FCC compliance tools, Canada CRTC formation,
Ansible infrastructure, and deployment scripts.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-27 06:54:22 -05:00

34 lines
1,016 B
Python

"""CDR format adapters.
Each adapter parses a switch-specific CDR file format into a normalized
``CDRRow`` stream consumed by the ingester. Selection is driven by the
``cdr_ingestion_profiles.format`` column (or inferred from a switch preset).
Contract: ``BaseCDRAdapter.iter_rows(path_or_bytes) -> Iterator[CDRRow]``
plus ``Adapter.FORMAT_SLUG`` and required-column metadata used by the
validator.
"""
from .base import BaseCDRAdapter, CDRRow, ValidationError
from .generic_csv import GenericCSVAdapter
from .asterisk import AsteriskAdapter
from .freeswitch import FreeSWITCHAdapter
from .netsapiens import NetSapiensAdapter
ADAPTERS: dict[str, type[BaseCDRAdapter]] = {
"generic_csv": GenericCSVAdapter,
"asterisk": AsteriskAdapter,
"freeswitch": FreeSWITCHAdapter,
"netsapiens": NetSapiensAdapter,
}
__all__ = [
"ADAPTERS",
"BaseCDRAdapter",
"CDRRow",
"ValidationError",
"GenericCSVAdapter",
"AsteriskAdapter",
"FreeSWITCHAdapter",
"NetSapiensAdapter",
]