This repository provides automated, daily backups of COVID-19 data from various Canadian government sources. Selected non-governmental sources are also included.
File name timestamps are given in ET (America/Toronto) in the following format: %Y%-m-%d_%H-%M. The script is run nightly around 23:00 ET.
All code in this repository is covered by the MIT License. Licenses and terms of use for each archived dataset are given below.
This repository is maintained by Jean-Paul R. Soucy on behalf of the COVID-19 Open Data Working Group.
Table of contents:
- Contributing
- Recommended citation
- Running archiver.py
- Data sources/terms of use/supplementary material
- Acknowledgements
Community members may contribute to this repository in three ways:
- Create an issue to request a dataset be added to the archive.
- Create a pull request for archiver.py adding the ability to automatically archive a requested or not-yet-implemented dataset.
- Submit archived versions of an existing, requested, or not-yet-implemented dataset. If possible, please use the original file name plus timestamp in the format described above.
COVID-19 Canada Open Data Working Group. Archive of COVID-19 Data from Canadian Government Sources. https://github.com/jeanpaulrsoucy/covid-19-canada-gov-data. (Access date).
archiver.py can run in four modes:
python archiver.py serverprod
: Download and commit files, running on the Heroku server.python archiver.py localprod
: Download and commit files, running on a local machine.python archiver.py servertest
: Download but do not commit files, running on the Heroku server.python archiver.py localtest
: Download but do not commit files, running on a local machine.
See archiver.py for more details.
The sources and terms of use for each included dataset are linked below. Supplementary material such as data dictionaries and codebooks are also included in the list below, if available. These files are included with the relevant datasets in a directory named supplementary
.
- COVID-19 Alberta statistics
- ab/cases/covid19dataexport.csv
- Terms of use: Assumed to be Open Government Licence - Alberta; see also the disclaimer in the "data notes" tab of the website
- COVID-19 relaunch status map
- ab/active-cases-by-region/covid19dataexport-relaunch.csv
- Terms of use: Assumed to be Open Government Licence - Alberta
- COVID-19 school status map
- ab/school-status-by-region/covid19dataexport-schools.csv
- Terms of use: Assumed to be Open Government Licence - Alberta
- BC COVID-19 Data
- Case data: bc/case-data/BCCDC_COVID19_Dashboard_Case_Details.csv
- The format of the column "Reported_Date" is %Y-%m-%d except for 2020-08-24 to 2020-08-26 where it is %m/%d/%Y.
- Due to Excel's aggressive date conversion, the column "Age_Group" may occasionally contain "19-Oct" rather than "10-19" (e.g., see this Twitter thread). This archive may not represent a perfect record of the appearance of "19-Oct" as some files may have been processed in Excel prior to upload, either removing or introducing the anomalous value.
- Data parsing advice for the above issues in R:
library(dplyr) dat <- read.csv("http://www.bccdc.ca/Health-Info-Site/Documents/BCCDC_COVID19_Dashboard_Case_Details.csv") %>% mutate( Reported_Date = coalesce(as.Date(Reported_Date, "%Y-%m-%d"), as.Date(Reported_Date, "%m/%d/%Y")), Age_Group = recode(Age_Group, "19-Oct" = "10-19") )
- Laboratory data: bc/laboratory-data/BCCDC_COVID19_Dashboard_Lab_Information.csv
- Terms of use: Disclaimer and data notes
- Case data: bc/case-data/BCCDC_COVID19_Dashboard_Case_Details.csv
- COVID-19 Public Exposures
- Public exposures webpage screenshot: bc/public-exposures-webpage/public-exposures-screenshot.png
- Public exposures - flights: bc/public-exposures-flights/public-exposures-flights-tables-Current.pdf
- Public exposures - cruises, long distance bus, train, work sites, public events: bc/public-exposures-cruises-bus-train-work-public/Archived_COVID-19_Exposures.pdf (Not included as part of the nightly update, as it is archived)
- Public exposures Fraser webpage: bc/regional-exposure-events-fraser-webpage/regional-exposure-events-fraser-webpage.html (warning: some early files are .png screenshots and named differently)
- Public exposures Interior webpage: bc/regional-exposure-events-interior-webpage/regional-exposure-events-interior-webpage.html (warning: some early files are .png screenshots and named differently)
- Public exposures Island webpage: bc/regional-exposure-events-island-webpage/regional-exposure-events-island-webpage.html (warning: some early files are .png screenshots and named differently)
- Public exposures Northern webpage: bc/regional-exposure-events-northern-webpage/regional-exposure-events-northern-webpage.html (warning: some early files are .png screenshots and named differently)
- Public exposures Vancouver Coastal webpage: bc/regional-exposure-events-vancouver-coastal-webpage/regional-exposure-events-vancouver-coastal-webpage.html (warning: some early files are .png screenshots or .pdf files and named differently and/or formatted differently)
- School exposures Fraser webpage: bc/school-exposures-fraser-webpage/school-exposures-fraser-webpage.html (warning: some early files are .png screenshots and named differently)
- School exposures Interior webpage: bc/school-exposures-interior-webpage/school-exposures-interior-webpage.html (warning: some early files are .png screenshots and named differently)
- School exposures Island webpage: bc/school-exposures-island-webpage/school-exposures-island-webpage.html (warning: some early files are .png screenshots and named differently)
- School exposures Northern webpage: bc/school-exposures-northern-webpage/school-exposures-northern-webpage.html (warning: some early files are .png screenshots and named differently)
- School exposures Vancouver Coastal webpage: bc/school-exposures-vancouver-coastal-webpage/school-exposures-vancouver-coastal-webpage.html (warning: some early files are .png screenshots and named differently)
- Vancouver Coastal reported its first school outbreak on 2020-09-22. However, due to a change in the page format, the first day these data were captured in the dataset was 2020-10-05. Screenshots prior to this date ommit the list of schools. However, it is unlikely that any schools were removed from the list prior to it first being captured on 2020-10-05.
- Terms of use: TBD
- Epidemiological summary of COVID-19 cases in Canada / COVID-19 Situational Awareness Dashboard
- Epidemiology update / Data on COVID-19 in Canada: can/epidemiology-update/covid19.csv
- Includes supplementary material: Data dictionary (English) and data dictionary (French)
- Epidemiology update / Data on COVID-19 in Canada: can/epidemiology-update/covid19.csv
- Epidemiological summary of COVID-19 cases in Canada / COVID-19 Situational Awareness Dashboard
- Epidemiology update / Data on COVID-19 in Canada: can/epidemiology-update/covid19-download.csv
- Identical to the above dataset but the date column is in YYYY-MM-DD format instead of DD-MM-YYYY
- Includes supplementary material: Data dictionary (English) and data dictionary (French)
- Epidemiology summary statements: can/epidemiology-summary-statements/covid19-epiSummary-statements.csv
- NML summary: can/nml-summary/covid19-epiSummary-NML.csv
- NML weekly testing: can/nml-weekly-testing/NML_weekly_testing.csv
- Number of cases with detailed case report data: can/detailed-case-report-n/covid19-nTotal.csv
- Cases and deaths by health region time series: can/cases-and-deaths-by-hr-time-series/file_out_v5.csv
- Health region UID table: can/health-region-uid/covid19-healthregions-hruid.csv
- Cases by exposure setting time series: can/cases-by-exposure-time-series/covid19-epiSummary-casesovertime.csv
- Epidemic curve by date of illness onset by age group: can/epidemic-curve-by-age/covid19-epiSummary-epiCurveByAge.csv
- Severity by age group and sex: can/severity-by-age-and-sex/covid19-epiSummary-severityUpdate.csv
- Cases by severity: can/cases-by-severity/covid19-epiSummary-severity.csv
- Cases by age group and sex: can/cases-by-age-and-sex/covid19-epiSummary-agegroups2.csv
- Cases by probable exposure setting: can/cases-by-probable-exposure-setting/covid19-epiSummary-probableexposure2.csv
- Symptoms summary: can/symptoms-summary/covid19-epiSummary-symptoms.csv
- Situational awareness dashboard update time: can/situational-awareness-dashboard-update-time/covid19-updateTime.csv
- Terms of use: Open Government Licence - Canada
- Epidemiology update / Data on COVID-19 in Canada: can/epidemiology-update/covid19-download.csv
- Detailed preliminary information on cases of COVID-19: 6 Dimensions (Aggregated data)
- can/detailed-preliminary-case-info-aggregated-6-dimensions/13100774.csv
- Includes supplementary material: Footnotes, metadata
- Terms of use: Statistics Canada Open Licence
- Detailed preliminary information on cases of COVID-19: 4 Dimensions (Aggregated data)
- can/detailed-preliminary-case-info-aggregated-4-dimensions/13100775.csv
- Includes supplementary material: Footnotes, metadata
- Terms of use: Statistics Canada Open Licence
- Detailed preliminary information on confirmed cases of COVID-19 (Revised)
- can/detailed-preliminary-confirmed-case-info-revised/13100781.csv
- Variable value definitions are given in footnotes (see supplementary material).
- This file has been processed to avoid the 100mb file limit on GitHub. (Base file size is > 400mb)
- Dataset has been pivoted from long to wide (names from: 'Case information', values from: 'VALUE').
- Columns containing no information have been dropped (GEO, DGUID, UOM, UOM_ID, SCALAR_FACTOR, SCALAR_ID, VECTOR, COORDINATE, STATUS, SYMBOL, TERMINATED, DECIMALS).
- Example of original data format is preserved (see supplementary material).
- Includes supplementary material: Footnotes, example of original data format, metadata
- Terms of use: Statistics Canada Open Licence
- Cases and Risk of COVID-19 in Manitoba
- COVID-19 data by RHA and district: mb/covid-data-by-rha-and-district/covid-data-by-rha-and-district.csv
- Cases by demographics and RHA: mb/cases-demographics-by-rha/cases-demographics-by-rha.csv
- Cases by status and RHA (Regional Health Authority): mb/cases-by-status-and-rha/cases-by-status-and-rha.csv
- Manitoba five-day test positivity rate: mb/five-day-test-positivity/five-day-test-positivity.csv
- Terms of use: TBD
- Data have been converted from JSON queries to CSV
- COVID-19 By-law Enforcement (Winnipeg)
- mb/winnipeg-by-law-enforcement/COVID-19_By-law_Enforcement.csv
- Terms of use: Open Government Licence - Winnipeg Not included as part of the nightly update, as it does not seem to be receiving regular updates (last new data: June 5, 2020)
- COVID-19 Designated Active Transportation Route Counts (Winnipeg)
- mb/winnipeg-active-transportation/COVID-19_Designated_Active_Transportation_Route_Counts.csv
- Terms of use: Open Government Licence - Winnipeg
- Not included as part of the nightly update, as it does not seem to be receiving regular updates (last updated: June 29, 2020)
- Coronavirus (COVID-19): case data
- ns/case-data/ns-covid19-data.csv
- Terms of use: Assumed to be Open Government Licence – Nova Scotia
- How Ontario is responding to COVID-19
- Webpage: on/ontario-webpage/ontario-webpage.html (warning: some early files are .png screenshots and named differently)
- Terms of use: Open Government Licence – Ontario
- Confirmed positive cases of COVID19 in Ontario
- on/confirmed-positive-cases/conposcovidloc.csv
- Includes supplementary material: Data dictionary (English and French)
- Terms of use: Open Government Licence – Ontario
- Status of COVID-19 cases in Ontario
- on/status-of-cases/covidtesting.csv
- Includes supplementary material: Data dictionary (English and French)
- Terms of use: Open Government Licence – Ontario
- COVID-19 testing of inmates in Ontario’s Provincial Correctional Institutions
- on/correctional-institutions-inmates-testing/inmatetesting.csv
- Includes supplementary material: Technical documentation (English and French)
- Terms of use: Open Government Licence – Ontario
- Status of COVID-19 cases in Ontario’s Provincial Correctional Institutions
- Long-Term Care Home COVID-19 Data
- Summary data: on/long-term-care-home-summary/ltccovidsummary.csv
- Active outbreaks: on/long-term-care-home-active/activeltcoutbreak.csv
- Resolved outbreaks: on/long-term-care-home-resolved/resolvedltc.csv
- Includes supplementary material: Data dictionary (English and French)
- Terms of use: Open Government Licence – Ontario
- COVID-19 cases in schools and child care centres
- Webpage: on/cases-schools-and-child-care-centres-webpage/cases-schools-and-child-care-centres-webpage.html (warning: some early files are .png screenshots and named differently)
- Terms of use: Open Government Licence – Ontario
- Schools COVID-19 data
- Summary of cases in schools: on/schools-summary/schoolcovidsummary.csv
- Schools with active COVID-19 cases: on/schools-active/schoolsactivecovid.csv
- Cases in school board partners: on/school-board-partners/schoolpartnersactivecovid.csv
- Terms of use: Open Government Licence – Ontario
- Licensed child care settings COVID-19 data
- Summary of cases in licensed child care settings: on/licensed-child-care-settings-summary/lccovidsummary.csv
- Licensed child care centres and agencies with active COVID-19 cases: on/licensed-child-care-settings-active/lccactivecovid.csv
- Terms of use: Open Government Licence – Ontario
- City of Toronto Daily Status of COVID-19 Cases
- on/toronto-daily-status/CityofToronto_COVID-19_Daily_Public_Reporting.xlsx
- Include supplementary material: Technical notes
- Terms of use: Assumed to be Open Government Licence – Toronto
- City of Toronto COVID-19 Summary
- on/toronto-covid-summary/CityofToronto_COVID-19_Data.xlsx
- Include supplementary material: Technical notes
- Terms of use: Assumed to be Open Government Licence – Toronto
- City of Toronto COVID-19 Neighbourhood Case Data
- on/toronto-neighbourhood-data/CityofToronto_COVID-19_NeighbourhoodData.xlsx
- Include supplementary material: Technical notes
- Terms of use: Assumed to be Open Government Licence – Toronto
- City of Toronto COVID-19 Neighbourhood Testing Data
- on/toronto-neighbourhood-test-data/CityofToronto_COVID-19_Testing.xlsx
- Include supplementary material: Technical notes
- Terms of use: Assumed to be Open Government Licence – Toronto
- City of Toronto COVID-19 Monitoring Dashboard
- on/toronto-monitoring-dashboard/CityofToronto_COVID-19_RecoveryData.xlsx
- Include supplementary material: Technical notes
- Terms of use: Assumed to be Open Government Licence – Toronto
- COVID-19 Cases in Toronto
- on/toronto-cases/COVID19_cases.csv
- Data are extracted at 3 PM on the Monday of a given week and posted by Wednesday [dataset is updated only on Wednesdays]
- Terms of use: Assumed to be Open Government Licence – Toronto
- University of Toronto COVID-19 tracking
- on/u-of-t-covid-tracking-webpage/u-of-t-covid-tracking-webpage.html (warning: some early files are .png screenshots and named differently)
- Data are reported every Monday with cumulative cases through the previous Friday [screenshots will be take every day in case the update frequency increases]
- Terms of use: TBD
- Daily COVID-19 Dashboard (Ottawa)
- Demographics and Source of Infection for Cases, Deaths, and Hospitalizations: on/ottawa-cases-deaths-hosp-demographics-source-of-infection/COVID-19_Cases_and_Deaths_Ottawa_EN.csv
- Outbreaks in Healthcare Institutions, Childcare, Summer Camps, and Educational Establishments: on/ottawa-outbreaks-healthcare-childcare-camps-schools/COVID-19_Institutional_Outbreaks.csv
- Community Outbreaks: on/ottawa-community-outbreaks/COVID-19_Community_Outbreaks_in_Ottawa.csv
- Weekly Rates: on/ottawa-weekly-rates/COVID-19_Weekly_Cases_and_Rates_by_Age_in_Ottawa_EN.csv
- Estimated Reproduction Number in Ottawa: on/ottawa-estimated-rt/EN_-_Covid-19_Reproduction_Number,_R(t).csv
- Testing - Ottawa Residents: on/ottawa-residents-tested/COVID-19_Ottawa_Residents_Tested_EN.csv
- Ottawa cases and deaths: on/ottawa-cases-and-deaths/COVID-19_Cases_and_Deaths_in_Ottawa_EN.csv (Archived as of 2020-09-21, no longer part of the nightly update)
- Ottawa outbreaks in healthcare institutions: on/ottawa-outbreaks-in-healthcare-institutions/COVID-19_Outbreaks_in_Ottawa_Healthcare_Institutions_EN.csv (Archived as of 2020-09-21, no longer part of the nightly update)
- Ottawa hospitalization data: on/ottawa-hospitalization/Hospitalizations_of_Ottawa_residents_with_confirmed_COVID-19.csv (Archived as of 2020-09-21, no longer part of the nightly update)
- Include supplementary material: User guide, technical guide, overall status assessment
- Terms of use: Open Government Licence – City of Ottawa
- Data on COVID-19 in Québec (province)
- Données COVID-19 au Québec (INSPQ)
- COVID-19 time series by region and demographics: qc/covid-time-series-by-region-and-demographics/covid19-hist.csv
- COVID-19 data (charts - summary, time series, and hospitalization by age): qc/covid-data-charts-summary-time-series-hosp-by-age/manual-data.csv
- Summary by region: qc/summary-by-region/regions.csv
- Deaths by RSS (health region) and living environment: qc/deaths-by-rss-and-living-environment/tableau-rpa-new.csv (Renamed from tableau-rpa.csv after 2020-09-16)
- Cases by RSS (health region) and RLS (local service network): qc/cases-by-rss-and-rls/tableau-rls-new.csv (Renamed from tableau-rls.csv after 2020-09-16)
- Comparisons (provinces): qc/comparisons-provinces/comparaisons_prov.csv
- Comparisons (countries): qc/comparisons-countries/comparaisons_pays.csv
- COVID-19 time series by region: qc/covid-time-series-by-region/PL_DATE.csv (Archived as of 2020-10-15, no longer part of the nightly update)
- COVID-19 data: qc/covid-data/combine.csv (Archived as of 2020-09-16, no longer part of the nightly update)
- COVID-19 data (charts): qc/covid-data-charts/combine2.csv (Archived as of 2020-09-16, no longer part of the nightly update)
- Terms of use: TBD
- Données COVID-19 par âge et sexe au Québec
- COVID-19 data by age group and sex: qc/covid-data-by-age-and-sex/PL_AGE_SEXE.csv
- Terms of use: TBD
- Situation du coronavirus (COVID-19) au Québec
- Deaths time series by living environment: qc/deaths-time-series-by-living-environment/decesquotidien.csv
- Recent daily cases by region: qc/recent-daily-cases-by-region/cas-region.csv
- Cumulative deaths by region: qc/cumulative-deaths-by-region/deces-region.csv
- Situation in Quebec: qc/situation-in-quebec/situation-au-quebec.csv
- Cases percentage by age group: qc/cases-percentage-by-age-group/pourcentage-cas-age.csv
- Deaths percentage by age group: qc/deaths-percentage-by-age-group/pourcentage-deces-age.csv
- COVID-19 daily data 7 days: qc/covid-data-daily-7-days/synthese-7jours.csv
- Cases by region 7 days: qc/cases-by-region-7-days/cas-region-7jours.csv
- Terms of use: TBD
- Situation dans les milieux de vie pour personnes aînées et vulnérables
- Status report on confirmed cases and deaths by RPA (private residences for seniors): qc/status-report-cases-and-deaths-by-rpa/etat_situation_rpa.pdf
- Status report on confirmed cases and deaths by CHSLD (residential and long-term care centres): qc/status-report-cases-and-deaths-by-chsld/etat_situation_chsld.pdf
- Supplementary material: Canadian Armed Forces report on their presence in CHSLDs
- Terms of use: TBD
- Situation dans les établissements scolaires
- Highlights - public and private school system: qc/schools-highlights/reseauScolaire_faitsSaillants.pdf
- List of schools - public and private school system: qc/schools-list-of-schools/reseauScolaire_listeEcoles.pdf
- Formerly Situation dans les établissements scolaires relative à la COVID-19: qc/schools-list-of-schools/etat_situation_ecole_2020-09-04_2020-09-06/etat_situation_ecole.pdf
- Formerly Liste des écoles ayant au moins un cas rapporté de la COVID-19 depuis le 1er septembre 2020: qc/schools-list-of-schools/liste-ecole-cas-rapportes_2020-09-08_2020-09-09/liste-ecole-cas-rapportes.pdf
- Terms of use: TBD
- Situation du coronavirus (COVID-19) à Montréal
- Note that these files are actually semicolon-separated since they use a comma as the decimal marker (rather than a period) and are encoded as ISO 8859-15 (rather than UTF-8)
- Montréal cases and deaths by CIUSSS (integrated health and social services centres): qc/montreal-cases-and-deaths-by-ciusss/ciusss.csv
- Montréal cases by area: qc/montreal-cases-by-area/municipal.csv
- Montréal cases and deaths by age group: qc/montreal-cases-and-deaths-by-age-group/grage.csv
- Montréal cases and deaths by sex: qc/montreal-cases-and-deaths-by-sex/sexe.csv
- Montréal epidemic curve: qc/montreal-epidemic-curve/courbe.csv
- Terms of use: TBD
- Saskatchewan's Dashboard - Total Cases
- CSV: sk/cases-by-region/cases.csv
- Webpage: sk/cases-by-region-webpage/cases-webpage.html (warning: some early files are .png screenshots and named differently)
- Terms of use: TBD
- Saskatchewan's Dashboard - Total Tests
- CSV: sk/tests-by-region/tests.csv
- Webpage: sk/tests-by-region-webpage/tests-webpage.html (warning: some early files are .png screenshots and named differently)
- Terms of use: TBD
- Canada COVID-19 School Case Tracker
- other/can/canada-covid-19-school-case-tracker/Canada_COVID-19_School_Report_Tracker.kml (original file name is Canada COVID-19 School Report Tracker.kml, renamed to avoid spaces in file name; warning: some early files are in .kmz format, which is compressed but handled almost identically to .kml)
- Terms of use: TBD
- Unofficial COVID Alert Dashboard
- Covid Écoles Québec: Number of schools
- Excel spreadsheet: other/qc/covid-ecoles-quebec-school-list/COVIDECOLESQUEBEC.xlsx (original file name is COVIDECOLESQUEBEC_20200905.xlsx, renamed to avoid confusion)
- Terms of use: TBD
Many people are to thank for contributing archived data and code to this repository.