nc-covid-tracking

command module
v0.0.0-...-7ee03a6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 30, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

README

nc-covid-tracking

Some scripts and data to help gather and process data from the NC DHHS about COVID-19.

For some visualizations of this data, see this Google Sheet.

bash scripts

There are a few bash scripts in this repository which simplify fetching data from the DHHS website.

1 fetch returns the JSON representation of the DHHS data. It just wraps the long ArcGIS URL in curl. 1 tocsv makes a handy CSV representation of that by county, for tinkering with in Google Sheets, etc. 1 daily-fetch is the script I run to populate the data/ directory.

data/ directory

I also capture the daily output of those scripts in the data/ directory, to establish a historical record of what DHHS published on what day. daily-fetch is a slightly optimized and more consistent way to do that, but it basically does this:

./fetch > data/$(date --rfc-3339=date).json
./fetch | ./tocsv > data/$(date --rfc-3339=date).csv

Go horizontal CSV

To make a stacked graph of this data by County over time in Google Sheets I needed to group the data by county "horizontally". Each county needs to be a column, with the number of cases in colums below it. That's tedious to do in Bash, so main.go contains some code to pull the JSON and output it in a horizontal representation.

Documentation

Overview

nc-covid-tracking exports three rows of CSV, suitable for graphing in Excel. The first row is a header, listing the counties in alpha-sorted order. The second row is the number of total cases per county. The third ros is the number of deaths per county.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL