https://github.com/gianlucatruda/titanic
An exhibition of my experience in data processing and visualisation. Python script to process and visualise the Titanic survivor data.
https://github.com/gianlucatruda/titanic
data database flask info matplotlib python science scrape server titanic visualisation web
Last synced: 3 months ago
JSON representation
An exhibition of my experience in data processing and visualisation. Python script to process and visualise the Titanic survivor data.
- Host: GitHub
- URL: https://github.com/gianlucatruda/titanic
- Owner: gianlucatruda
- License: gpl-3.0
- Created: 2016-10-10T09:35:25.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-10-10T19:33:00.000Z (over 9 years ago)
- Last Synced: 2025-02-08T15:35:13.029Z (over 1 year ago)
- Topics: data, database, flask, info, matplotlib, python, science, scrape, server, titanic, visualisation, web
- Language: CSS
- Homepage: https://gianlucatruda.wordpress.com/projects/
- Size: 1.53 MB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Click the above image to see a YouTube demo.
What is this?
-----------
This is a relatively simple project to exhibit the extent of my experience
with data processing and visualisation.
Installation
------------
Perform a simple "git clone" request from the URL
https://github.com/gianlucatruda/titanic.git
and all the relevant files will be downloaded.
Please also ensure the Python 3.4 is installed,
along with the following libraries:
* Matplotlib
* Requests
* Flask
If they aren't installed, you can install them through 'pip3'
by opening your terminal and typing
```sudo pip3 install {name of library}```
to install.
If 'pip3' is not installed, install it by typing
```sudo apt-get install python3-pip```
Usage Instructions
-----------------------------
In terminal, navigate to the project directory.
This directory should contain 'titanic.py'.
Type
```python3 titanic.py```
to run the script.
Once it responds, a Flask server has been established
on your local machine.
Navigate to http://localhost:8080/
to begin engaging with the software.
When you are finished, press CTRL+C in terminal
to quit the script.
NOTE: If you are viewing the pages multiple times, it
might be necessary to do a 'hard refresh' to ensure
that the new data is loaded into the browser
instead of cached data.
How does it work?
-----------
It consists of a single Python 3.4 script, which is responsible for
the vast majority of the functionality. This is complemented with
html files (and associated assets, scripts, etc.) to enhance the
aesthetic experience.
The script works in 3 stages:
1. Starts a Flask server on http://localhost:8080
and serves up a landing page with more info.
2. Waits for the user to request the data set,
at which point the Requests library is
used to pull the JSON data from
https://titanic.businessoptics.biz/survival .
A predefined class 'Passenger' is
instantiated for each parameter set (processed from
the JSON data).
3. Once the data has successfully been downloaded and
processed, Matplotlib is utilised to generate detailed
graphics to illustrate the embarked/surviving data
across Sex, Age, and (cabin) Class.
These graphics are rendered as .png files and
then served up through Flask to the browser.
Contacts
--------
* Gianluca Truda
* trdgia001@myuct.ac.za
* http://gianlucatruda.wordpress.com
