This Python CLI application is used to filter data from CSV files from two datasets related to the COVID-19 pandemic:
- Global Hospital Beds Capacity (for covid-19) by Igor Kiulian
- COVID-19 containment and mitigation measures by Paul Mooney
Python 3.x, any version of pip, and virtualenv
-
Clone into a new directory and navigate inside it
-
Create a new virtual environment using virtualenv for Windows or venv for Linux
For example,
virtualenv venv
orpython3 -m venv venv
respectively -
Activate venv
For Windows:
.\venv\Scripts\activate.bat
For Unix/Linux:
source venv/bin/activate
or./venv/bin/activate.sh
(Run the
deactivate
command when done with this software's execution) -
Install dependencies
pip install -r requirements.txt
Use either python main.py
or python3 main.py
(according to your system) for a guided Command Line Interface menu, or execute using arguments as follows:
python main.py <index of dataset> <index of filter> [post]
For the values of datasets:
- Bed capacity
- Measures and restrictions
Bed capacity's filters:
- Number and percentage of beds per type, by country (scale)
- Top 10 countries with highest bed capacity (scale)
- Top 10 countries with lowest bed capacity (scale)
- Top 10 countries with highest bed capacity (estimated total)
- Top 10 countries with lowest bed capacity (estimated total)
- Top 10 countries with highest average bed capacity (scale)
- Top 10 countries with lowest average bed capacity (scale)
- Top 10 countries with highest average bed capacity (estimated)
- Top 10 countries with lowest average bed capacity (estimated)
- General dataset statistics
Measures and restrictions filters:
- General measures information by country
- Top 10 countries with highest number of different measures/restrictions
- Top 10 countries with lowest number of different measures/restrictions
- Top 10 countries with highest number of measures/restrictions records
- Top 10 countries with lowest number of measures/restrictions records
- General dataset information
Finally, the optional argument 'post' can be added to send a request to the defined backend API
Activate the virtual environment and run the program using a CLI. Follow the instructions that appear on screen (only shown in argumentless CLI mode)
You will find the generated JSON files in the export folder
The generated output files are stored in ./export/beds/. These files are named with the _GENERAL and _TYPES suffixes to indicate whether they refer to general information or specific bed types information. The file name prefixes are the respective filters.
Same as above, but stored in ./export/measures/ and with the _GENERAL and _MEASURES suffixes