Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/minho42/hospital-ranking
🏥 Hospitals ranked by Google reviews, Australia
https://github.com/minho42/hospital-ranking
python selenium vue
Last synced: 16 days ago
JSON representation
🏥 Hospitals ranked by Google reviews, Australia
- Host: GitHub
- URL: https://github.com/minho42/hospital-ranking
- Owner: minho42
- License: mit
- Created: 2020-09-28T17:05:07.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-02-04T19:02:42.000Z (11 months ago)
- Last Synced: 2024-02-04T21:35:59.842Z (11 months ago)
- Topics: python, selenium, vue
- Language: Python
- Homepage: https://hospitalranking.netlify.app
- Size: 2.96 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# hospital-ranking
Scrapes Google ratings information (stars and review count) for Australian hospitals without using Google Maps API
---
## Requirement
- Python 3
- Google Chrome
- Chromedriver## Usage
Copy the source code
```shell
git clone https://github.com/minho42/hospital-ranking.git
cd hospital-ranking/
```Optional: Use virtual environment
```shell
python -m venv venv
source venv/bin/activate
```Install required packages
```shell
pip install -r requirements.txt
```[Download](https://chromedriver.chromium.org/downloads) Chromedriver
Change variable `CHROME_DRIVER_PATH` in `app.py`
[Download](https://www1.health.gov.au/internet/main/publishing.nsf/Content/hospitals2.htm) raw data ('Current Listing of Commonwealth declared hospitals')
Change filename to `all_hospitals.xlsx`
Run the script (this takes a long time, like > 30 minutes)
```
python app.py
```Eventually, `ranking.json` is generated in `frontend/` i.e. `frontend/ranking.json` which can be used in the frontend app
---
## Variables in app.py
### RAW_DATA_FILE
`all_hospitals.xlsx`
### EXTRACTED_DATA_FILE
`all_hospitals.json`
```json
[
{
"sector": "PUBLIC",
"state": "NSW",
"name": "CONCORD REPATRIATION HOSPITAL"
}
]
```## RATING_FILE
`rating.json`
```json
[
{
"sector": "PUBLIC",
"state": "NSW",
"name": "CONCORD REPATRIATION HOSPITAL",
"stars": "2.9",
"reviews": "288"
}
]
```### RANKING_FILE
`frontend/ranking.json`
```json
[
{
"sector": "PUBLIC",
"state": "NSW",
"name": "CONCORD REPATRIATION HOSPITAL",
"stars": "2.9",
"reviews": "288",
"ranking": "2.9022899952150216"
}
]
```## Ranking Formula
weighted rating (WR) = (v / (v + m)) _ R + (m / (v + m)) _ C
R = average for the hospital (mean) = (Rating)
v = number of reviews for the hospital = (reviews)
m = minimum reviews required to be listed (currently 1)
C = the mean review across the whole reviews
Referenced from https://www.quora.com/How-does-IMDbs-rating-system-work