Python Services & Automation

Role: Use this guide when modifying backend scripts or understanding the syncing logic.

1. Environment

  • Interpreter: python3 (Managed via venv in root or Conda).
  • Dependencies: Listed in requirements.txt (common libs: pandas, sqlite3, matplotlib).

2. Key Scripts

sync_registers.py

  • Purpose: Syncs data between raw CSVs and the SQLite databases.
  • Location: Register/System/Scripts/
  • Trigger: Runs automatically on CL-sync or manually via terminal.

dashboard_generator.py

  • Purpose: Generates static JSON/Assets for the Quartz frontend from DB data.
  • Output: Writes to Quartz_CL/content/Registers/Data/.
  • Logic: Aggregates SQL queries into visualization-ready formats.

Rules for AI

  1. Paths: Always use relative paths from the project root.
  2. Logging: Use the standard logging library, not print().
  3. Error Handling: Scripts must fail gracefully and not break the build pipeline.