- Switch to async lifespans, eager in‑memory caching of calendar data, and ORJSON responses for reduced latency.
- Add structured logging and GZIP middleware, enforce year bounds and directory existence. - Replace json module with orjson, use pathlib and TypedDict aliases, and implement typed argument parsing with explicit error handling.
- Remove unused test.py and refactor scraper CLI to accept argv via function injection, simplify input mode logic.
- Preserve backward defaults (produce both single JSON and directory output) while exposing explicit flags via argparse.
This refactor improves scalability on low‑resources servers, adds robustness checks, and clarifies the command‑line interface for future extensions.