Skip to content

Instantly share code, notes, and snippets.

@anandology
Last active April 3, 2020 00:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anandology/60d877c2255e193015012ea9cf92bec6 to your computer and use it in GitHub Desktop.
Save anandology/60d877c2255e193015012ea9cf92bec6 to your computer and use it in GitHub Desktop.
Build a CLI application to list the number of covid19 cases and death in India.

Write a CLI application to list the number of covid19 cases and deaths in India.

You can use the following API for getting that data:

https://github.com/anandology/covid19

The required interface is:

$ python covid19.py cases 
STATE CONFIRMED ACTIVE DEATHS
----- --------- ------ ------
india      2069   1913    53
mh          335    293    13
tn          234    228    1
..


$ python covid19.py cases --date 2020-03-20
STATE CONFIRMED ACTIVE DEATHS
----- --------- ------ ------
india       223    200     4
mh           52     52     1
kl           28     25     0
..

$ python covid19.py daily-cases 
DATE       CONFIRMED ACTIVE DEATHS
---------- --------- ------ ------
2020-04-02      2069   1913     53
2020-04-01      1834   1690     41
...

$ python covid19.py daily-cases --state mh
DATE       CONFIRMED ACTIVE DEATHS
---------- --------- ------ ------
2020-04-02       335    293     13
2020-04-01       302    263      9
...

Hint: You can use click for the cli and tabulate for the showing data in tables.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment