{"id":23390,"library":"canvasapi","title":"Canvas LMS API Wrapper","description":"A Python wrapper for the Canvas LMS API. Provides object-oriented access to Canvas resources like courses, users, assignments, and more. Current version 3.6.0, released 2026-03-12. Regular releases approximately every 6 months.","status":"active","version":"3.6.0","language":"python","source_language":"en","source_url":"https://github.com/ucfopen/canvasapi","tags":["canvas-lms","api-wrapper","education","lms"],"install":[{"cmd":"pip install canvasapi","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"HTTP client used for API calls","package":"requests","optional":false},{"reason":"Timezone handling for datetime objects","package":"pytz","optional":false}],"imports":[{"note":"Canvas is a top-level export","wrong":"from canvasapi.canvas import Canvas","symbol":"Canvas","correct":"from canvasapi import Canvas"},{"note":"Course uses are returned from Canvas methods; direct import not common","wrong":"cannot import from canvasapi.course directly before Canvas object","symbol":"Course","correct":"from canvasapi import Course"}],"quickstart":{"code":"from canvasapi import Canvas\n\n# Replace with your Canvas instance URL and API key\napi_url = 'https://canvas.instructure.com'\napi_key = os.environ.get('CANVAS_API_KEY', '')\n\ncanvas = Canvas(api_url, api_key)\nuser = canvas.get_current_user()\nprint(f\"Hello, {user.name}!\")\n\n# List courses\ncourses = canvas.get_courses()\nfor course in courses:\n    print(course.name)","lang":"python","description":"Initialize a Canvas object with your instance URL and API key, then fetch current user and courses."},"warnings":[{"fix":"Catch 'canvasapi.exceptions.RateLimitExceeded' instead of relying on HTTP 403.","message":"API rate limits can cause 'RateLimitExceeded' exceptions (3.5.0+). Previously these were raised as 'Forbidden' (HTTP 403). If you catch rate limits, check your exception handling.","severity":"gotcha","affected_versions":">=3.5.0"},{"fix":"Use 'QuizSubmission.update_score_and_comments()' or similar.","message":"'set_quiz_score' and related quiz score methods were removed in v3.0.0. Use quiz submission endpoints instead.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Upgrade to Python 3.9, 3.10, 3.11, 3.12, or 3.13.","message":"Python 3.7 and 3.8 support dropped in v3.4.0. Use Python 3.9+.","severity":"deprecated","affected_versions":">=3.4.0"},{"fix":"Use 'list(canvas.get_courses())' to materialize the list.","message":"Branching from PaginatedList into two separate lists can exhaust the iterator. Always convert to list if you need to reuse the iteration.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"pip install canvasapi","cause":"canvasapi not installed","error":"ModuleNotFoundError: No module named 'canvasapi'"},{"fix":"Ensure you pass a valid API key to the Canvas constructor.","cause":"Invalid or missing API key","error":"canvasapi.exceptions.Unauthorized: 401 Unauthorized"},{"fix":"Iterate over the PaginatedList or convert to list first: 'list(canvas.get_courses())'","cause":"Trying to access a method directly on PaginatedList instead of iterating","error":"AttributeError: 'PaginatedList' object has no attribute '...'"},{"fix":"Use 'canvas = Canvas(url, key)' after 'from canvasapi import Canvas'","cause":"Forgetting to import and using wrong reference","error":"TypeError: 'Canvas' object is not callable"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}