This project automates the download and visualization of hospital institution data from the Taiwan National Health Insurance (NHI) website.
Using Python and Selenium, it simulates browser interaction to download hospital datasets in CSV format. The script converts these datasets into Excel files, enriches the data with translated labels, and generates three types of visualizations:
- 📊 Stacked bar chart
- 📋 Summary table
- 🥧 Pie chart
All output files are timestamped and stored in structured folders. Logs are recorded throughout the process for traceability and debugging purposes.
- Fully automated Selenium-based data download
- Converts downloaded CSV files to Excel format
- Appends translated English labels for division and hospital type
- Generates publication-ready visualizations with Matplotlib
- Structured folder management and logging system
/src/ ← Python automation and visualization script
/images/ ← Output charts and tables (optional)
/example/ ← Sample input CSVs or logs (optional)
This project requires the following packages:
pip install pandas matplotlib selenium openpyxlYou will also need:
- Chrome browser
- ChromeDriver (must match your Chrome version and be added to PATH)
-
Clone the repository and navigate to the
/src/folder. -
Edit
main.pyif needed (e.g., modify target URLs or folder paths). -
Run the script:
python main.py
-
The script will:
- Create folders on your Desktop (
Health_Care_Institutions/csv,excel,visualizations,log) - Download and rename CSV files
- Generate Excel files
- Produce stacked bar chart, pie chart, and table image
- Save all outputs with timestamps
- Create folders on your Desktop (
All charts will be saved in the /visualizations/ folder, e.g.:
Here are examples generated by the script:
All hospital datasets are retrieved from Taiwan’s NHI open data platform:
https://info.nhi.gov.tw/IODE0000/IODE0000S09
This repository is for educational and demonstration purposes only.
This project is licensed under the MIT License.
Feel free to reuse or modify the code with proper attribution.


