GitHub 2 Canvas
Learning Goals
- Build Canvas lessons from the command line
- Improve the vibes with Python
Introduction
The current github-to-canvas Ruby gem has caused me enough grief that I have taken time out of my first build week to rewrite it in Python.
github-2-canvas is still very much under construction, but the functions and details will be added in as I complete them.
Important Information
GitHub 2 Canvas relies on two environment variables that must be set before it is run:
CANVAS_API_KEY is an API key that can be generated from account settings in Canvas. It should be stored in your .zshrc or .bashrc file with this exact name.
CANVAS_API_URL is the API endpoint that the script will access. This should be made known through your IT team. The CANVAS_API_URL at Flatiron should be 'https://learning.flatironschool.com' and it should be stored in yoru .zshrc or .bashrc file with this exact name.
hello
hello allows users to confirm that they can connect to the Canvas course that they're interested in modifying.
Format for command line input is as follows:
python github-2-canvas hello [course_id]
convert
convert allows users to convert their markdown code to HTML.
Format for command line input is as follows:
python github-2-canvas convert [md_filename]
convert returns the absolute path of the newly created HTML file.
create
Creates Page (only pages at this point) using the following syntax:
python github-2-canvas.py create [md_filename] [course_id]