You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
573 B
16 lines
573 B
"""Per-parliament adapters: source records in, plenum columns out.""" |
|
from __future__ import annotations |
|
|
|
import importlib |
|
from typing import Any |
|
|
|
|
|
def load_adapter(module_path: str) -> Any: |
|
"""Import the adapter module named in parliament.yaml `sources.adapter`.""" |
|
try: |
|
return importlib.import_module(module_path) |
|
except ModuleNotFoundError as exc: |
|
raise ModuleNotFoundError( |
|
f"Could not import adapter {module_path!r} from parliament.yaml. " |
|
f"See docs/PORTING.md for what an adapter must provide." |
|
) from exc
|
|
|