Kamaropoulos / COVID19Py

A tiny Python package for easy access to up-to-date Coronavirus (COVID-19, SARS-CoV-2) cases data.
https://pypi.org/project/COVID19Py/
GNU General Public License v3.0
84 stars 57 forks source link

COVID19Py with aggregates #73

Closed lotkin98 closed 3 years ago

lotkin98 commented 3 years ago

This is functionally the exact same as the original. The big difference is that an aggregate pattern has been applied to the code. Essentially 3 classes have been added to the covid19.py file. The CaseOccurrence class acts as the root. The caseLocation and the covidCases classes contain the getLocationByCountry and getLatest methods that are identical to the original however they are now used in the CaseOccurence class, which provides encapsulation. An instance of CaseOccurence is made in the main class and used in the respective methods (in order for the software to perform the same functions as in the originals).