Welcome to the Data Analysis Proof of Concept Project! This project serves as a demonstration of data analysis, statistical analysis, and visualization using Flask, Docker, matplotlib and Pandas.
- A web framework for building and serving the data analysis application.
- Flask allows you to create web applications in Python.
- A containerization platform to ensure a consistent and isolated environment for your application.
- Simplifies deployment by encapsulating the application and its dependencies in a container.
- A powerful data manipulation and analysis library for Python.
- Used for loading and analyzing datasets in this project.
- A popular plotting library for Python.
- Utilized for creating visualizations, such as scatter plots.
da-flask-docker
│ .dockerignore
│ .gitignore
│ app.py ------------ this is main app file
│ compose.yaml
│ Dockerfile
| requirements.txt
│ environment.yml --- conda env file
│ README.Docker.md
│ README.md
│
├───data
│ kc_house_data.csv
│
├───scripts
│ analyze_data.py
│
│
├───static
│ │ scatter_plot.png
│ │
│ └───css
│ style.css
│
├───templates
index.html
-
Install the required Python packages. It's recommended to use a virtual environment:
python -m venv venv source venv/bin/activate # On Windows, use 'venv\Scripts\activate' pip install -r requirements.txt
note - python 3.12 is recommended
-
or, Install the Conda environment:
conda env create -f environment.yml conda activate python-flask
If you prefer to run the application without Docker, follow these steps:
-
Make sure you have activated your virtual environment:
source venv/bin/activate
On Windows, use
venv\Scripts\activate
Or if using Conda:
conda activate python-flask
-
Run the Flask application:
python app.py
-
Open your web browser and go to http://localhost:5000 to access the application.
-
The data analysis script is located in
scripts/analyze_data.py
. -
Customize the analysis as needed in the
analyze_data
function. -
Run the script:
python scripts/analyze_data.py
This will generate summary statistics, correlation matrices, and a scatter plot.
-
Install Docker: Docker Installation Guide
-
Clone the repository:
git clone https://github.com/your-username/da-flask-docker.git
-
Change to the project directory:
cd da-flask-docker
-
Build and run the Docker container:
docker-compose up --build
Your application will be available at http://localhost:5000.
-
Build your Docker image:
docker build -t myapp .
-
If your cloud uses a different CPU architecture, specify the platform:
docker build --platform=linux/amd64 -t myapp .
-
Push the image to your registry:
docker push myregistry.com/myapp
Replace
myregistry.com
with your actual registry.
Consult Docker's getting started docs for more details on building and pushing.