R/get_canvas_py_code_header.R

Defines functions get_canvas_py_code_header

Documented in get_canvas_py_code_header

#' Retrieve the header Python code for sending commands to Canvas
#'
#' Internal function. Retrieves the header Python code for sending commands to Canvas.
#' @keywords internal
get_canvas_py_code_header <- function() {
  token <- get_canvas_token()
  course_id <- get_course_id()
  url <- get_API_URL()

  paste0("from canvasapi import Canvas
token = '", token, "'
url = '", url, "'
connection = Canvas(url, token)
course = connection.get_course(", course_id, ")")
}
nikola-sur/teachr documentation built on April 21, 2022, 4:50 a.m.