Coder Social home page Coder Social logo

minho42 / hospital-ranking Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 3.03 MB

๐Ÿฅ Hospitals ranked by Google reviews, Australia

Home Page: https://hospitalranking.netlify.app

License: MIT License

Python 46.42% JavaScript 4.84% HTML 7.46% Vue 40.82% CSS 0.46%
python selenium vue

hospital-ranking's Introduction

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

git clone https://github.com/minho42/hospital-ranking.git
cd hospital-ranking/

Optional: Use virtual environment

python -m venv venv
source venv/bin/activate

Install required packages

pip install -r requirements.txt

Download Chromedriver

Change variable CHROME_DRIVER_PATH in app.py

Download 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

[
  {
    "sector": "PUBLIC",
    "state": "NSW",
    "name": "CONCORD REPATRIATION HOSPITAL"
  }
]

RATING_FILE

rating.json

[
  {
    "sector": "PUBLIC",
    "state": "NSW",
    "name": "CONCORD REPATRIATION HOSPITAL",
    "stars": "2.9",
    "reviews": "288"
  }
]

RANKING_FILE

frontend/ranking.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

hospital-ranking's People

Contributors

dependabot[bot] avatar minho42 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.