A squishy quiz based on the Encyclopedia of Life. Match the picture to the species!
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
static
templates
.gitignore
Pipfile
Pipfile.lock
Procfile
README.md
licence.md
planigale.py
planigale_flask.py
requirements.txt
runtime.txt
species.json
species.pickle
wsgi.py

README.md

planigale

Planigale is a game that challenges you to match the picture of the species with its Latin name.

Available as a web app and on the command line.

Data for Planigale were taken from the Encyclopedia of Life, a repository of all the species known to mankind.

Many cute! Much fun!


Command line version

Planigale was originally built for the command line. If you want to play, planigale works from version 1.0, but the latest version also works on command line.

alt tag

Dependencies

  • Python 3

  • Install the following non built-in libraries using pip:

    • pillow for image processing
    • jsonpickle for object serialization to json

    You can install library dependencies using pip install -r requirements.txt (this will also install dependencies for web planiagle as well)

Usage

  • clone this repo to your computer
  • cd to the planigale directory in the terminal
  • run python planigale.py

Web app

Planigale was a full-stack learning experience. We refactored the command line game into a Flask app, designed the front-end from scratch, hosted it on Heroku and stored the gameplay state in Redis.

Dependancies

  • Python 3.5.0
  • In addition to the libraries used for the command line version above, install the following non-built-in libraries using pip:
    • flask is a micro web framework which makes it easy to create web applications.
    • redis is a Python interface to the popular key-value store which is super fast and easy to set up. We used this to implement server-side sessions.
    • gunicorn is a WSGI container which is required for hosting this app in a production environment.

Usage

Before running planigale on a local (or remote) host, you must configure two environment variables. Instructions to set environment variables vary based upon your OS and platform.

  • REDIS_URL must be set to the URL of the Redis instance which is being used for hosting the app. We used a free Redis to Go instance from heroku.
  • PLANIGALE_KEY must be set to a random value to ensure consistent client side sessions for flask here for more info).

Local host

Follow the below instructions to run the planigale web application locally.

  • clone this repo to your computer
  • cd to the planigale directory in terminal
  • install library dependencies using pip install -r requirements.txt
  • Run..
    • python planigale_flask.py for flask server in debug mode OR..
    • gunicorn planigale_flask:app --log-file=- for gunicorn server with WSGI logs displayed to console.
  • open a web browser. planigale should be hosted at http://localhost:5000/

Remote Host

Heroku was used for hosting this flask app. There are some good instructions for getting started with Python on Heroku here. This repository already contains the required files for hosting this on heroku.

  • runtime.txt is required to specify the Python 3.5.0 runtime for the heroku build process.
  • requirements.txt specifies the library requirements for the heroku build process.
  • Procfile specifies the commands and processes which should be run after completing the heroku build process.

If you have the heroku toolbelt installed, you can run the application locally using these settings using the command heroku local from the planigale directory.