[ANN] CMDC.jl : Client library to open COVID-19 database

Hi everyone!

Iโ€™m part of a team that has been hard at work on the COVID Modeling Data Collaborative (CMDC)

We are a grant funded initiative to provide researchers, modelers, and policy makers with all the data they need in order to answer key questions to help with a safe start of social and economic behaviors.

We accomplish this goal in several ways:

  • Collect unique, hard-to-acquire, datasets that are not widely distributed

  • Aggregate data collected by other related organizations into a centralized database

  • Work with other related organizations to expand and improve their data collection processes

  • Build tools, client libraries, and APIs to make the data as easy to access as possible

As part of this effort we have developed a Julia client library, CMDC.jl

We know many in the Julia community are involved in COVID-19 related work either as part of their official assignment or a passion side-project. Weโ€™d love to make your data process easier

Please check out CMDC.jl on github and give it a try!

As always, if you spot any issues or problems donโ€™t hesitate to open up an issue and weโ€™ll get it fixed.

Quick example

(@1.4) pkg> add https://github.com/valorumdata/CMDC.jl

#... some messages

julia> using CMDC
[ Info: Precompiling CMDC [2a7f7b87-7961-4068-ab29-b8c7bac6b897]

julia> c = Client()
CMDC Client

julia> datasets()
8-element Array{Symbol,1}:
 :states
 :counties
 :covid_historical
 :covid
 :demographics
 :mobility_locations
 :economics
 :mobility_devices

help?> demographics
search: demographics

  CMDC endpoint demographics

  Currently, the following variables are collected in the database

    โ€ข    Total population

    โ€ข    Median age

    โ€ข    Fraction of the population over 65

    โ€ข    Fraction of the population who identify as various races or as Hispanic/Latino

    โ€ข    Fraction of the population with various degrees of education

    โ€ข    Fraction of the population that commutes in various ways

    โ€ข    Mean travel time to work (minutes)

    โ€ข    Median household income

    โ€ข    Mean household income

    โ€ข    Fraction of the (civilian) population with/without health insurance

    โ€ข    Fraction of families who had an income less than poverty level in the last year

  These variables are collected from the 2018 American Community Survey (5 year) in order to ensure that we have data for each county. Please note that we are willing (and easily able!) to
  add other years or variables if there is interest โ€“- The variables that we do include are because people have asked about them.

  Source(s):

  US Census American Community Survey (https://www.census.gov/programs-surveys/acs)

  Available filters are: meta_date, fips, variable, value, select, order, offset and limit

  Set any filter as keyword argument to demographics() function

julia> request!(c, demographics(), covid(fips="<100"))
CMDC Client. Current request:
 - demographics
 - covid
  - fips: <100


julia> df = fetch(c)
^R
4963ร—39 DataFrames.DataFrame. Omitted printing of 34 columns
โ”‚ Row  โ”‚ fips  โ”‚ Fraction of population over 65_2018-01-01 โ”‚ Mean household income_2018-01-01 โ”‚ Mean travel time to work (minutes)_2018-01-01 โ”‚ Median age_2018-01-01 โ”‚
โ”‚      โ”‚ Int64 โ”‚ Union{Missing, Float64}                   โ”‚ Union{Missing, Float64}          โ”‚ Union{Missing, Float64}                       โ”‚ Float64?              โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ 1    โ”‚ 1     โ”‚ 17.0                                      โ”‚ 69091.0                          โ”‚ 25.2                                          โ”‚ 39.3                  โ”‚
โ”‚ 2    โ”‚ 1     โ”‚ 17.0                                      โ”‚ 69091.0                          โ”‚ 25.2                                          โ”‚ 39.3                  โ”‚
โ”‚ 3    โ”‚ 1     โ”‚ 17.0                                      โ”‚ 69091.0                          โ”‚ 25.2                                          โ”‚ 39.3                  โ”‚
โ”‚ 4    โ”‚ 1     โ”‚ 17.0                                      โ”‚ 69091.0                          โ”‚ 25.2                                          โ”‚ 39.3                  โ”‚
โ”‚ 5    โ”‚ 1     โ”‚ 17.0                                      โ”‚ 69091.0                          โ”‚ 25.2                                          โ”‚ 39.3                  โ”‚
โ”‚ 6    โ”‚ 1     โ”‚ 17.0                                      โ”‚ 69091.0                          โ”‚ 25.2                                          โ”‚ 39.3                  โ”‚
โ”‚ 7    โ”‚ 1     โ”‚ 17.0                                      โ”‚ 69091.0                          โ”‚ 25.2                                          โ”‚ 39.3                  โ”‚
โ”‚ 8    โ”‚ 1     โ”‚ 17.0                                      โ”‚ 69091.0                          โ”‚ 25.2                                          โ”‚ 39.3                  โ”‚
โ”‚ 9    โ”‚ 1     โ”‚ 17.0                                      โ”‚ 69091.0                          โ”‚ 25.2                                          โ”‚ 39.3                  โ”‚
โ”‚ 10   โ”‚ 1     โ”‚ 17.0                                      โ”‚ 69091.0                          โ”‚ 25.2                                          โ”‚ 39.3                  โ”‚
โ”‚ 11   โ”‚ 1     โ”‚ 17.0                                      โ”‚ 69091.0                          โ”‚ 25.2                                          โ”‚ 39.3                  โ”‚
โ”‚ 12   โ”‚ 1     โ”‚ 17.0                                      โ”‚ 69091.0                          โ”‚ 25.2                                          โ”‚ 39.3                  โ”‚
โ”‚ 13   โ”‚ 1     โ”‚ 17.0                                      โ”‚ 69091.0                          โ”‚ 25.2                                          โ”‚ 39.3                  โ”‚
โ”‚ 14   โ”‚ 1     โ”‚ 17.0                                      โ”‚ 69091.0                          โ”‚ 25.2                                          โ”‚ 39.3                  โ”‚
โ”‚ 15   โ”‚ 1     โ”‚ 17.0                                      โ”‚ 69091.0                          โ”‚ 25.2                                          โ”‚ 39.3                  โ”‚
โ”‚ 16   โ”‚ 1     โ”‚ 17.0                                      โ”‚ 69091.0                          โ”‚ 25.2                                          โ”‚ 39.3                  โ”‚
โ”‚ 17   โ”‚ 1     โ”‚ 17.0                                      โ”‚ 69091.0                          โ”‚ 25.2                                          โ”‚ 39.3                  โ”‚
โ”‚ 18   โ”‚ 1     โ”‚ 17.0                                      โ”‚ 69091.0                          โ”‚ 25.2                                          โ”‚ 39.3                  โ”‚
โ”‚ 19   โ”‚ 1     โ”‚ 17.0                                      โ”‚ 69091.0                          โ”‚ 25.2                                          โ”‚ 39.3                  โ”‚
โ”‚ 20   โ”‚ 1     โ”‚ 17.0                                      โ”‚ 69091.0                          โ”‚ 25.2                                          โ”‚ 39.3                  โ”‚
โ”‚ 21   โ”‚ 1     โ”‚ 17.0                                      โ”‚ 69091.0                          โ”‚ 25.2                                          โ”‚ 39.3                  โ”‚
โ”‚ 22   โ”‚ 1     โ”‚ 17.0                                      โ”‚ 69091.0                          โ”‚ 25.2                                          โ”‚ 39.3                  โ”‚
โ”‚ 23   โ”‚ 1     โ”‚ 17.0                                      โ”‚ 69091.0                          โ”‚ 25.2                                          โ”‚ 39.3                  โ”‚
โ‹ฎ
โ”‚ 4940 โ”‚ 56    โ”‚ 16.7                                      โ”‚ 81935.0                          โ”‚ 16.2                                          โ”‚ 38.5                  โ”‚
โ”‚ 4941 โ”‚ 56    โ”‚ 16.7                                      โ”‚ 81935.0                          โ”‚ 16.2                                          โ”‚ 38.5                  โ”‚
โ”‚ 4942 โ”‚ 56    โ”‚ 16.7                                      โ”‚ 81935.0                          โ”‚ 16.2                                          โ”‚ 38.5                  โ”‚
โ”‚ 4943 โ”‚ 56    โ”‚ 16.7                                      โ”‚ 81935.0                          โ”‚ 16.2                                          โ”‚ 38.5                  โ”‚
โ”‚ 4944 โ”‚ 56    โ”‚ 16.7                                      โ”‚ 81935.0                          โ”‚ 16.2                                          โ”‚ 38.5                  โ”‚
โ”‚ 4945 โ”‚ 56    โ”‚ 16.7                                      โ”‚ 81935.0                          โ”‚ 16.2                                          โ”‚ 38.5                  โ”‚
โ”‚ 4946 โ”‚ 56    โ”‚ 16.7                                      โ”‚ 81935.0                          โ”‚ 16.2                                          โ”‚ 38.5                  โ”‚
โ”‚ 4947 โ”‚ 56    โ”‚ 16.7                                      โ”‚ 81935.0                          โ”‚ 16.2                                          โ”‚ 38.5                  โ”‚
โ”‚ 4948 โ”‚ 56    โ”‚ 16.7                                      โ”‚ 81935.0                          โ”‚ 16.2                                          โ”‚ 38.5                  โ”‚
โ”‚ 4949 โ”‚ 56    โ”‚ 16.7                                      โ”‚ 81935.0                          โ”‚ 16.2                                          โ”‚ 38.5                  โ”‚
โ”‚ 4950 โ”‚ 56    โ”‚ 16.7                                      โ”‚ 81935.0                          โ”‚ 16.2                                          โ”‚ 38.5                  โ”‚
โ”‚ 4951 โ”‚ 56    โ”‚ 16.7                                      โ”‚ 81935.0                          โ”‚ 16.2                                          โ”‚ 38.5                  โ”‚
โ”‚ 4952 โ”‚ 56    โ”‚ 16.7                                      โ”‚ 81935.0                          โ”‚ 16.2                                          โ”‚ 38.5                  โ”‚

julia> names(df)
39-element Array{String,1}:
 "fips"
 "Fraction of population over 65_2018-01-01"
 "Mean household income_2018-01-01"
 "Mean travel time to work (minutes)_2018-01-01"
 "Median age_2018-01-01"
 "Median household income_2018-01-01"
 "Percent Asian_2018-01-01"
 "Percent Hispanic/Latino (any race)_2018-01-01"
 "Percent Native American or Alaska Native_2018-01-01"
 "Percent Native Hawaiian or other Pacific Islander_2018-01-01"
 "Percent black_2018-01-01"
 "Percent of 16+ commute carpool_2018-01-01"
 "Percent of 16+ commute driving alone_2018-01-01"
 "Percent of 16+ commute other way_2018-01-01"
 "Percent of 16+ commute public transit_2018-01-01"
 "Percent of 16+ commute walk_2018-01-01"
 "Percent of 16+ commute work at home_2018-01-01"
 "Percent of 25+ with Associate degree_2018-01-01"
 "Percent of 25+ with Bachelor degree_2018-01-01"
 "Percent of 25+ with HS degree but no college_2018-01-01"
 "Percent of 25+ with less than 9th grade education_2018-01-01"
 "Percent of 25+ with professional degree_2018-01-01"
 "Percent of 25+ with some HS but no HS degree_2018-01-01"
 "Percent of 25+ with some college but no degree_2018-01-01"
 "Percent of civilian population with health insurance_2018-01-01"
 "Percent of civilian population with no health insurance_2018-01-01"
 "Percent of families w/ income < poverty lvl in last year_2018-01-01"
 "Percent other race_2018-01-01"
 "Percent two or more races_2018-01-01"
 "Percent white_2018-01-01"
 "Total population_2018-01-01"
 "vintage"
 "dt"
 "deaths_total"
 "hospital_beds_in_use_covid_total"
 "icu_beds_in_use_covid_total"
 "negative_tests_total"
 "positive_tests_total"
 "ventilators_in_use_covid_total"

julia>
18 Likes

Great initiative, thank you for sharing.

Two questions about it, if I may:

  • I had a quick look at the provided data via the GraphQL API on your website and saw that you only provide data for USA. On your main page you refer to the CSSE data repo for international comparisons. Do you plan to incorporate international data into the CMDC database?

  • In the FAQ section you state that the use of the data is free because of the project funding which is great. The CMDC repo itself is licensed under MIT license which is great as well. So do I understand it correctly that if I want to use the data provided by CMDC for my university teaching, I would be free to do so?

Thanks in advance.

1 Like

Re non-US data โ€“ yep, we plan to do this very soon. You should see international data appear hopefully within the next week.

Also regarding usage: absolutely! The data and libraries are open and free for all. The more usage the better โ€“ no restrictions!

1 Like