This is a Flask server that implements a minimal web-based interface to the Olin College 2016-2017 course catalog.
Python 3 is required to run this program.
You can test whether Python 3 is installed on your laptop by running python3 --version
in the bash (shell) command line:
$ python --version
Python 2.7.6
$ pip3 install flask
$ pip3 install pandas
- Run
$ python3 server.py
- Browse to http://127.0.0.1:5000/. (The
python3 server.py
command also prints this URL.)
If you're having trouble installing Python, Flask, or Pandas on your development machine, use the following instead.
The second step takes a long time the first time you run it, but is much faster after that.
-
Install Docker. This works on macOS, Windows, and Ubuntu (as well as many other Linux distributions). This is only necessary once.
-
Run
docker-compose up
in the command line -
Browse to http://127.0.0.1:5000/
server.py
is a web application, written using the Flask web framework.
See here for information on using Flask.
The application uses pandas to read the (CSV) data file,
and to filter the list of courses down to specific areas.
templates/*.html
are the HTML templates that are served in response to HTTP requests to the server.
See the Flask documentation for more information about how this works.
These are Jinja templates; read here for information about Jinja.
data/
contains data files. This is currently limited to:
data/olin-courses-16-17.csv
is CSV file that lists the courses.
See the first line of the file itself for a description of its columns.
scripts/scrape_course_catalog.py
scrapes the http://www.olin.edu web site to create the data file.
This script makes heavy use of pandas.
Ask IT first before you run this script – it could look look like an attack on the web site.
As with all web scraping, this script is fragile – a minor change to the olin.edu web design or URL format
could break it with no warning.
Written by Oliver Steele [email protected].
This code is made available under the MIT License.