Skip to content

Instantly share code, notes, and snippets.

Avatar

Jean-Paul R. Soucy jeanpaulrsoucy

View GitHub Profile
@jeanpaulrsoucy
jeanpaulrsoucy / git_export_all_file_versions.sh
Created Nov 24, 2021
Extract all versions of a file from the Git repository history.
View git_export_all_file_versions.sh
#!/bin/sh
# based on script provided by Dmitry Shevkoplyas at http://stackoverflow.com/questions/12850030/git-getting-all-previous-version-of-a-specific-file-folder
set -e
if ! git rev-parse --show-toplevel >/dev/null 2>&1 ; then
echo "Error: you must run this from within a git working directory" >&2
exit 1
fi
@jeanpaulrsoucy
jeanpaulrsoucy / bc-archive-data.py
Created Sep 22, 2021
Download archived BC COVID-19 hospitalization and ICU data into a single spreadsheet
View bc-archive-data.py
# Download archived BC COVID-19 hospitalization data from the Archive of Canadian COVID-19 Data
# and extract data from JSON files into a single CSV spreadsheet
# https://github.com/ccodwg/Covid19CanadaArchive
# bug: there may be a few dates with duplicate data from when the archive tool downloaded the same file twice in one day
# load modules
import os
import re
import json
View on-pharmacy-covid-vaccines.md

Scrape COVID-19 pharmacy vaccine locations for Ontario

Jean-Paul R. Soucy (jprs.me)

Let's scrape the names, addresses and public health units of pharmacies in Ontario offering the COVID-19 vaccine from the provincial website.

# load packages
library(rvest)
library(stringr)
View covid-variants-can.Rmd
# Scraping and plotting Canadian COVID-19 VOC data
*Jean-Paul R. Soucy*
Let's scrape the VOC data from the [CTV News variant tracker](https://www.ctvnews.ca/health/coronavirus/tracking-variants-of-the-novel-coronavirus-in-canada-1.5296141) (maintained by journalists [Jesse Tahirali](https://twitter.com/jessetahirali) and [Stephanie Liu](https://twitter.com/_stephanieliu)) and the [Public Health Agency of Canada](https://health-infobase.canada.ca/covid-19/epidemiological-summary-covid-19-cases.html#VOC).
```{r variant-data}
# load packages
library(jsonlite)
suppressPackageStartupMessages(library(dplyr))
View mb-school-data.md

Scraping data from Manitoba COVID-19 school outbreaks

Jean-Paul R. Soucy

Let's scrape the 14-day school-associated case counts from the Manitoba Schools Dashboard.

We begin by loading the package we need to grab the JSON data.