The Simple Analysis System is a lightweight Flask-based web application that provides quick insights into COVID-19 data by country. It processes historical case data to generate key statistics like total cases, total deaths, and peak infection days for any country in the dataset.
- Data Processing: The system reads COVID-19 data from a CSV file (
covid_data.csv) containing daily case reports - Analysis Engine: When a user submits a country name:
- Filters the dataset for that country
- Calculates total cases and deaths
- Identifies the peak infection day
- Optional Storage: Can store results in an SQLite database for future reference (using APSW)
- Web Interface: Presents results in a simple, user-friendly format
- Fast country-specific COVID-19 analysis
- Minimal dependencies (Flask, pandas, and optionally APSW)
- Clean web interface with instant results
- Optional data persistence
- github installation and directory
apt-get update -y && apt-get upgrade -y
apt-get install python git
git clone https://github.com/Elang-elang/SASTPython.git -
Prepare your data:
- Create a
covid_data.csvfile with columns:date, country, cases, deaths - Sample data format:
2020-01-22,China,548,17 2020-03-01,Italy,1701,41
- Create a
-
Run the application:
python app.py
-
Access the web interface at
http://localhost:5000 -
Enter a country name (e.g., "Italy") and view results:
- Total Cases
- Total Deaths
- Peak Infection Day
The core functionality is implemented in app.py which:
- Uses Flask for web interface
- Leverages pandas for data analysis
- Optionally stores results using APSW/SQLite
# Core analysis function
def analyze_data(country_name):
country_data = df[df['country'].str.lower() == country_name.lower()]
summary = {
'total_cases': int(country_data['cases'].sum()),
'total_deaths': int(country_data['deaths'].sum()),
'peak_day': str(country_data.loc[country_data['cases'].idxmax()]['date'].date())
}
return summary- Python 3.x
- Flask
- pandas
- APSW (optional for database storage)
Install requirements with:
pip install flask pandas apsw- Add visualization of case trends
- Support for date-range filtering
- Comparative analysis between countries
- Automated data updates from public sources