Package: clanvas
ClanvasCommand-line shell client for theCanvas Learning Management SystemAvailable CommandsIn the Clanvas shell, all commands already on your systemPATHare available.
You canlsandgrepas you please.In addition, the shell provides the following commands:CommandMeaninglclist classesccchange current classlalist assignmentslglist gradeslannlist announcementscatannprint announcementspullfpull course filesuaupload submission to assignmentwopenopen in web interfacewhoamishow login infoquitquit the shellTypehelpto see all commands, and use the-hflag to show usage details for any particular command.InstallationClanvas is hosted onPyPiand can be installed withpip.Clanvas requires Python 3.6+pip install clanvasTheclanvascommand should now be on your path!Usage will also requiregenerating a Canvas API tokenwhich will be used to log in.Note: in order to have 100% proper line editing and tab completion support, further configuration may be required.Clanvas relies on the capabilities provided byGNU readlineor an equivalent library. The situation varies by system.LinuxGNU readlineis most likely already installed, no further configuration required.macOSApple ships it's operating system with the BSD-licensededitlinesinceGNU readlineis released under a GPL (copyleft) license. By default, Clanvas will try to useeditlineif this is what is available. However, certain features like navigating previous commands and tab completion may not work correctly in all cases. The best/recommended solution is to ensure you are using Python withGNU readline. SeeGNU readline on macOSfor more details.WindowsCurrently Windows is untested, but the we recommend installing thepyreadlinePython module.LoginStart the Clanvas shell by providing a config entry or URL.For example, with the following config file at~/.clanvas/config...Host school
	Url https://canvas.school.edu
	Token bOYc5cOIldA3eB9NTr7X0Um9Z8TPMACb0HtdgHTMtp10T5UKH0b4HOqTmOCvWZlYRpJ9dN...login can be done with the hostnameschool$ clanvas school 
bmr23@canvas.school.edu:~:~ $Otherwise, if a URL can is provided then you are prompted for an access token:$ clanvas https://canvas.school.edu
Enter access token:SeeGenerating an API Tokenfor more info on the access token.Example UsageRun commandsbmr23@canvas.school.edu:~:~ $ lc -l
EECS 325  7832  Spring 2018  Computer Networks (100/5013)
EECS 338  6939  Spring 2018  Operating Systems (100/4593)
EECS 391  7136  Spring 2018  Artificial Intelligence (100/4163)
EECS 345  6937  Spring 2018  Programming Language Concepts (100/4699)
bmr23@canvas.school.edu:~:~ $ cc 325
bmr23@canvas.school.edu:EECS 325:~ $ lg -g
Computer Networks (100/5013)
├── Quizzes
│   ├── Quiz 1 100/100 100%
│   ├── Quiz 2 85/100 85%
│   └── Quiz 3 95/100 95%
├── Exams
│   └── Exam 1 86/100 86%
└── Homework
    ├── HW 1 20/20 100%
    ├── HW 2 18/20 90%
    └── HW 3 17/20 85%
bmr23@canvas.school.edu:EECS 325:~ $ pullf
bmr23@canvas.school.edu:EECS 325:~ $ tree ~/canvas/courses/EECS325-7832/files
/home/bob/canvas/courses/EECS325-7832/files
├── HW1_2018S.pdf
├── HW2_2018S.pdf
├── HW3-2018S.pdf
├── HW Solutions
│   └── HW1_2018S_Solutions
├── Lecture Notes
│   ├── Lecture1.ppt
│   ├── Lecture2.ppt
│   ├── Lecture3_Layering_AppLayerOverview.ppt
│   ├── Lecture4_5_Web.ppt
│   ├── Lecture6_DNS_CDN.ppt
│   ├── Lecture7_SMTP_P2P_SPAM.ppt
│   ├── Lecture8-Sockets_TransportIntro.ppt
│   └── Lecture9-UDP_RelXmit.ppt
├── Project1Files.zip
├── Project1Instructions.pdf
└── Syllabus.pdfGenerating an API TokenNavigate to /profile/settingsUnder the "Approved Integrations" section, click the button to generate a new access token.Once the token is generated, you cannot view it again, so you'll have to generate a new token if it is lost.GNU readline on macOSTo check which line editor library your current python is using, check the output ofecho "import readline\nprint(readline.__doc__)" | pythonYou should see one of the following messages.Importing this module enables command line editing using GNU readline.
Importing this module enables command line editing using libedit readline.If you see the first message, you are good to go!If you see the latter, the easiest fix is to install and configureAnaconda, a package manager that provides a Python distribution that comes withGNU readlineset up as the command line editor.InstallAnaconda$ brew cask install anacondaAdd Anaconda binaries to your path by amending your~/.bash_profileor~/.zshrcfile# At some point after your PATH is defined...
export PATH=/usr/local/anaconda3/bin:"$PATH"Save and then source your edited rc file withsource ~/.zshrcor equivalent (or restart your terminal).NowAnaconda's commands are available to use!Create a new virtual environment$ conda create --name py36 python=3.6Now, somewhere after theexport PATH=/usr/local/anaconda3/bin:"$PATH"line in your rc file, add the following line:source activate py36Save your rc file, and once againsource ~/.zshrcor equivalent.Check your Python version, you should seeAnaconda, Inc.in the name.$ python --version
Python 3.6.4 :: Anaconda, Inc.Now check ifGNU readlineis being used$ echo "import readline\nprint(readline.__doc__)" | python
Importing this module enables command line editing using GNU readline.Congratulations, you have installed and set up a Python distribution withGNU readline!Runpip install clanvasto celebrate.ContributingPull requests are welcome! Check out thecontributingpage for details
on how to help.Built WithThese projects are used very directly, and both welcome pull requests. If you want to add an uncovered
canvas endpoint, or change the behavior of the shell itself, check out these projects:cmd2 (shell functionality)canvasapi (canvas lms api wrapper)LicenseThis project is licensed under the MIT License. See theLICENSEfile for details.