Python Services & Automation
Role: Use this guide when modifying backend scripts or understanding the syncing logic.
1. Environment
- Interpreter:
python3(Managed viavenvin 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-syncor 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
- Paths: Always use relative paths from the project root.
- Logging: Use the standard
logginglibrary, notprint(). - Error Handling: Scripts must fail gracefully and not break the build pipeline.