Giter Site home page Giter Site logo

zillion-covid-19's Introduction

Zillion COVID-19

This is an example repo showing how one can use Zillion to analyze data related to the COVID-19 outbreak.

The zillion warehouse is defined in zillion_covid_19/covid_warehouse.json. It references a remote sqlite database that is pulled from the Glide COVID-19 repo. The warehouse is configured to ignore the download if the sqlite database already exists locally (check in /tmp for glide_covid_19.db), so it is a one-time snapshot unless you adjust the if_exists setting in covid_warehouse.json or periodically remove your local sqlite DB so it gets refreshed on the next warehouse init.

To see the available warehouse metrics, dimensions, and datasources try the following from the zillion_covid_19 directory:

$ python warehouse.py

"""
---- Warehouse
metrics:
  {
      'cases': <Metric name='cases' type='integer'>,
      'cases_cumsum': <Metric name='cases_cumsum' type='integer'>,
      'cumulative_cases': <Metric name='cumulative_cases' type='integer'>,
      ...
"""

To run reports on the command line use the run_report.py helper script. The following example would show cases and deaths by country for a particular date (not cumulative, there are separate metrics for that):

$ python run_report.py -m cases deaths -d country -c '[("date", "=" , "2020-04-02")]'

"""
             Cases  Deaths
Country
Afghanistan     36       2
Albania         18       1
Algeria        139      28
Andorra         38       1
Angola           0       0
...            ...     ...
Venezuela        3       2
Vietnam         15       0
Yemen            0       0
Zambia           3       1
Zimbabwe         1       0
"""

Use --help for more information. The output is simply a printed dataframe, so data may be truncated in the terminal.

Note: this is meant to be a quick example. Zillion is still in its infancy and is subject to rapid changes.

zillion-covid-19's People

Contributors

yazgoo avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.