How lofiturtle/canvastrello works
Project Type and Purpose
• This is an open-source integration tool (ETL-style sync) written in Python.
• Purpose: fetch assignments from Canvas courses (Canvas REST API) and populate them as cards on a Trello board (Trello REST API).
File Structure
• Top-level scripts/modules:
• canvashelper.py – encapsulates Canvas API calls and data parsing
• trellohelper.py – encapsulates Trello API calls (creating/updating cards)
• sync.py – orchestration layer: reads config, calls helpers in sequence
• secretstemplate.py / secrets.py – configuration holder for API tokens, URLs, course IDs, list IDs
• No subdirectories – a simple, single-process command-line tool.
Extract Insights from the README
• Workflow is one-way: Canvas → Trello.
• Security: credentials live in secrets.py, never checked into source.
• Deployment: “Run sync.py on a schedule” (cron, CI/CD, serverless scheduler).
Main Components
a. Local Environment / Runtime
• Python VM (virtualenv/container)
• Configuration store (secrets.py)
• Orchestrator script (sync.py)
b. Functional Modules
• CanvasHelper module – fetches assignments via Canvas REST API
• TrelloHelper module – posts/updates cards via Trello REST API
c. External Services
• Canvas REST API (HTTPS endpoint)
• Trello REST API (HTTPS endpoint)
• Trello Calendar plugin (optional—read-only calendar view)
d. Scheduler (optional)
• Cron job or external scheduler that invokes sync.py at intervals
Relationships & Data Flows
• sync.py loads secrets.py → instantiates CanvasHelper and TrelloHelper
• CanvasHelper → GET assignments from Canvas REST API → returns list of assignments
• sync.py → passes assignment list to TrelloHelper → POST/PUT cards to Trello REST API
• Trello API → updates board (lists/cards) → Calendar plugin reflects new cards
• (Scheduler) → triggers sync.py periodically
Architectural Patterns & Principles
• Separation of concerns:
• canvashelper.py encapsulates all Canvas logic
• trellohelper.py encapsulates all Trello logic
• sync.py orchestrates without business logic
• Configuration decoupling: secrets.py separate from code
• Single responsibility: small, testable modules
• Stateless design: each run stands alone, no persistent local DB
Technologies & Frameworks
• Python 3.9+
• Requests or an HTTP client (in requirements.txt/Pipfile)
• Possible scheduler (cron or serverless)