← Files ClaraARCHIVED FILE
modules/period-comparison/scripts/run_period_comparison.py
1.56 KB · Oct 6, 2026 · 06:02 UTC
"""CLI entry point for period-comparison chart generation."""
from __future__ import annotations
# Direct CLI calls must select dependencies before importing workflow modules.
if __name__ == "__main__":
import runpy as _runpy
from pathlib import Path as _Path
for _parent in _Path(__file__).resolve().parents:
_launcher = _parent / "scripts" / "self_relaunch.py"
if not _launcher.is_file():
_launcher = _parent / "clara" / "scripts" / "self_relaunch.py"
if _launcher.is_file():
_runpy.run_path(str(_launcher))["ensure_running_in_managed_venv"](__file__)
break
else:
# Standalone components retain their host's dependency setup.
if any(
(_p / "components.json").is_file()
for _p in _Path(__file__).resolve().parents
):
raise SystemExit(
"Managed Python launcher is missing; rebuild the plugin package."
)
import argparse
from period_core import add_common_args, configure_logging, run_period_comparison
def main() -> int:
"""Run the period-comparison workflow."""
parser = argparse.ArgumentParser(description="Run period-comparison charts.")
add_common_args(parser)
args = parser.parse_args()
configure_logging(args.verbose)
run_period_comparison(
args.input_file,
args.output_dir,
args.recipe,
language=args.language,
currency=args.currency,
artifact_mode=args.artifact_mode,
)
return 0
if __name__ == "__main__":
raise SystemExit(main())
SHA-256: fa537e3a80e794ce07107ae5ac6d9882841416015d1071e919939ade4e3351aa