excel_to_docs.py 986 B

123456789101112131415161718192021222324252627282930313233
  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. """
  4. excel_to_docs.py
  5. Thin wrapper that invokes the Excel → Documents converter implemented
  6. in convert_local.py, keeping a clearer entrypoint name.
  7. Usage:
  8. python prompt-library/scripts/excel_to_docs.py --excel "prompt (2).xlsx"
  9. # optional:
  10. # --category-name <fallback> --config prompt-library/scripts/config.yaml
  11. """
  12. from __future__ import annotations
  13. import importlib.util
  14. import sys
  15. from pathlib import Path
  16. def main() -> None:
  17. script = Path(__file__).resolve().parent / "convert_local.py"
  18. spec = importlib.util.spec_from_file_location("convert_local", str(script))
  19. if spec is None or spec.loader is None:
  20. raise RuntimeError("Unable to load convert_local.py")
  21. module = importlib.util.module_from_spec(spec)
  22. sys.modules["convert_local"] = module
  23. spec.loader.exec_module(module) # type: ignore
  24. # Delegate to its CLI
  25. module.main() # type: ignore
  26. if __name__ == "__main__":
  27. main()