This is a project to provide a set of command line utilities for running a course on box.com.
You need the following libraries to use box-course
- requests (http://www.python-requests.org/en/latest/) this library is used for the box.com v2 API.
- PyPDF2 (https://github.com/mstamy2/PyPDF2) The gradebook needs to be able to read data from PDF files. We try to use this python module, but some pdfs cannot be read by it.
- pdftk (http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/) This is a fallback executable used to read pdfs. It is slower than the python module in my opinion, so we only use it if the python module fails.
Finally, you need to install box-course. Clone the git repository, and use pip install -e box-course
to install it as a developer.
For CMU users, go to https://cmu.app.box.com/developers/services/edit/ to create a Box application. you will need a name for your application. You will get an API key (also known as your client id), and a client_secret. Make a note of these.
You have to come back later to this site to add the Redirect url for authentication.
To authenticate and get your tokens, you need to have access to a web-server. Install the cgi-script in box_course/cgi-bin/box-course-authenticate on your server. You need to figure out how to set environment variables for your client id and secret. For apache, you can put this in the httpd.conf file:
<Directory "/var/www/cgi-bin"> AllowOverride All # this is the line that allows the override Options None Order allow,deny Allow from all </Directory>
Then, in the /var/www/cgi-bin create a .htaccess file with these contents:
SetEnv CLIENT_ID "fjdklaff8d9a798syf7fa" SetEnv CLIENT_SECRET "uKo6aLD5RmqenaUAUOF3mDhmDHsGoY1A"
When you visit your cgi-script, e.g.
http://yourhost/cgi-bin/box-course-authenticate
You will be taken to the box site to put in your password and approve the app, then you will get a token.json file in return that you need to save on your hard drive. Make note of where you save it, because you need it to configure box-course.
Create a directory you want your course to be in, and in that directory create a file called box_course_config.py, based on this example ./box_course/box_course_config_example.py. Put a copy of the course roster in this directory also. Run box-course init
in that directory to setup the course.
More to come later
one problem is I want to use the course roster, which contains andrewids. I need to include other email addresses too. I could add these to the roster, but they wold be deleted with updates.
I think I need an extra roster file, with the same format, but with email addresses.
The file needs this format for consistency year, email, lastname, firstname
F13, [email protected], Kitchin, John
I really want a command line ability to add, remove and edit collaborations, tasks, etc…
box-cli collab –add –remove –edit box-cli task –add –remove –edit