Package: canadacovidmetrics
canadacovidmetricsThis is a Python package that provides key metrics regarding COVID-19 situation in Canada across provinces using theOpenCovid API.SummaryThis package allows users to obtain key metrics on COVID-19 situation in Canada at national or provincial level for a specific time period. The 4 functions will return key metrics, including total cumulative cases, total cumulative deaths, total cumulative recovered cases and total cumulative vaccine completion, using data fromOpenCovid API. The users may use the key metrics to conduct further analyses on COVID-19 situation in Canada.FunctionsThere are 4 functions in this package:get_casesQuery total cumulative cases with ability to specify province and date range of returned data.get_deathsQuery total cumulative deaths with ability to specify province and date range of returned data.get_recoveriesQuery total cumulative recovered cases with ability to specify province and date range of returned data.get_vaccinationsQuery total cumulative vaccine completion with ability to specify province and date range of returned data.Installation$pipinstallcanadacovidmetricsUsage & ExamplesTotal number of deaths over past week by provincefromcanadacovidmetricsimportcanadacovidmetricsasccmimportdatetimeasdtdeaths_last_week=ccm.get_deaths(after=str(dt.date.today()-dt.timedelta(days=7)))deaths_last_week.groupby('province').sum('deaths').plot.barh(y='deaths',title='Deaths by province in past week');National vaccination completion in 2021fromcanadacovidmetricsimportcanadacovidmetricsasccmvaccines_2021=ccm.get_vaccinations(loc='canada',after='2021-01-01',before='2021-12-31')vaccines_2021.plot('date_vaccine_completed','cumulative_cvaccine',title='Cumulative national vaccinations');Daily new case count by provincefromcanadacovidmetricsimportcanadacovidmetricsasccmcases_data=ccm.get_cases().set_index('date_report')cases_data.groupby('province')['cases'].plot(legend=True,figsize=(10,6),title='Number of reported cases by day by province');Python ecosystemThere are several packages for easy access to COVID-19 key metrics or data using different APIs, examples includecovidusingJohn Hopkins University APICOVID19PyusingCoronavirus Tracker APIcovid19pyclientusingRKI APITo our knowledge, there is no similar package usingOpenCovid APIin the Python ecosystem.DocumentationDocumentation canadacovidmetrics can be found atRead the DocsContributorsAdam Morphy (@adammorphy)Brandon Lam (@ming0701)Lakshmi Santosha Valli Akella (@valli180)Luke Collins (@LukeAC)We welcome and recognize all contributions. Please find the guide for contribution inContributing Document.Licensecanadacovidmetricswas created by the Contributors. The dependant API from the COVID-19 Canada Open Data Working Group dataset project has adopted theCreative Commons Attribution 4.0 Internationallicense, which allows freedom of two primary contributions:Sharing— copy and redistribute the material in any medium or formatAdapting— remix, transform, and build upon the material
for any purpose, even commercially.As contributors to this community, our package has adopted the same creative commons license, in order to enable anyone to share or adapt the Canada Covid Metrics package in R or Python subject to the license.Creditscanadacovidmetricswas created withcookiecutterand thepy-pkgs-cookiecuttertemplate.