Giter VIP home page Giter VIP logo

coronapy-cli's Introduction

coronapy-cli

A command line tool to fetch worldwide data about COVID-19.

MIT License PR's Welcome Python Versions PyPi Version Alt PyPi Downloads Open Source


Stay Home, Stay Safe.

coronapy-cli

Track the Coronavirus disease (COVID-19) in the command line.

  • πŸš€ Get worldwide Coronavirus disease (COVID-19) reporting
  • 🀯 Active daily reporting of your country's COVID-19 statistics
  • πŸ—ƒοΈ Data: Country, Cases, Deaths, Recovered, Active, Critical
  • πŸ₯ƒ Soon : Get Mroccan States data for Coronavirus disease reports

Data Source

Install

pip install coronapy-cli

πŸ“Ÿ

Project Structure

β”œβ”€β”€β”€.github
β”œβ”€β”€β”€coronapy
β”‚    β”œβ”€β”€β”€lib
β”‚    β”‚   β”œβ”€β”€β”€__init.py__
β”‚    β”‚   β”œβ”€β”€β”€color.py
β”‚    β”‚   β”œβ”€β”€β”€get_countries.py
β”‚    β”‚   β”œβ”€β”€β”€get_country.py
β”‚    β”‚   └───get_world_wide.py
β”‚    β”œβ”€β”€β”€__init__.py
β”‚    └───cli.py
β”œβ”€β”€β”€.gitignore
β”œβ”€β”€β”€LICENSE.txt
β”œβ”€β”€β”€Pipfile
β”œβ”€β”€β”€Pipfile.lock
β”œβ”€β”€β”€READMR.md
β”œβ”€β”€β”€setup.cfg
└───setup.py

Development

Setup

  1. Clone the repo and cd into it.

  2. Set up a Python 3 virtual environment using pipenv:

    pipenv --three         # create Python 3 virtual environment
    pipenv install --dev   # install all dependencies
    pipenv shell           # activate virtual environment shell
  3. The script can be run from the root directory of the project:

    python3 -m coronapy.cli --help

Usage

Worldwide Information

# Display data for all total cases, recovery, and deaths.
coronapy all

# Display a chart of Total Cases, Total Deaths and Recovered Cases.
coronapy all --chart

# Alias: Display  a char.
coronapy all -c

πŸ“Ÿ

All Countries

# Display data for all countries.
coronapy countries

# Sort data by type, the default type is 'cases'.
coronapy countries --sort cases

# Alias: Sort data by type.
corcoronapyona countries -s recovered

# limit the number of results to the specified value.
coronapy countries --limit 5  

# Alias: limit the number of results .
coronapy countries -l 5

πŸ“Ÿ

Single Country

# Display data for given country.
coronapy country <country_name>

# Display a chart of Total Cases, Total Deaths and Recovered Cases for given country i.e. China.
coronapy country China --chart

# Alias: Display  a char.
coronapy country China -c

# Display a histogram shows cases or deaths data in last 20 day for given country i.e. USA.
coronapy country usa --hist

# You can set what kind of data (cases or deaths), the default is 'cases'.
coronapy country usa --hist --type cases
coronapy country usa --hist --type deaths

# Alias: Histogram & data type.
coronapy country usa -h -t cases

πŸ“Ÿ

Sort Data

# All sorting parameters.
coronapy countries -s country
coronapy countries -s cases
coronapy countries -s todayCases
coronapy countries -s deaths
coronapy countries -s todayDeaths
coronapy countries -s recovered
coronapy countries -s active
coronapy countries -s critical

πŸ“Ÿ

CLI Help

# Display the help data.
coronapy --help

To Do

  • Add Screenshots.
  • Catch and handle exceptions. (Complete)
  • Make --help command better.
  • Add Mroccan States data for Coronavirus disease reports.
  • Add US States data for Coronavirus disease reports.
  • Testing code.
  • More Code Refactor!
  • More... (have suggestions? let me know!)

Issues

If you're facing a problem in using coronapy-cli please let me know by creating an issue in this github repository. I'm happy to help you! Don't forget to provide some screenshot or error logs of it!

Contributing

Contributions are welcome, create a pull request to this repo and I will review your code.

Contributors list


Mouad Boulahdoud

Misha Lisovyi

aymaneMx

Mouad ZIANI

Amitay

kudos

OkiStuff

Jose M. Segura Polanco

Yasser Tahiri

Authors

  • MouadBH

License

This project is licensed under the MIT License - see the LICENSE.txt file for details

Sponsor

This project sponsored by tea πŸ₯ƒ.

coronapy-cli's People

Contributors

amitay87 avatar aymanemx avatar darkcode01 avatar mlisovyi avatar mouadbh avatar mouadziani avatar okistuff avatar y1n0 avatar yezz123 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

coronapy-cli's Issues

Tab completion

i thought may be we want to implement a tab-completion for the available commands and their values (list of countries for example)

Usage of ISO codes

Great tool for python users! Thanks for introducing it.

The country endpoint of NovelCOVID/API supports usage of ISO codes for contries, e.g. DE/DEU for Germany. However, their historical endpoint does not support ISO codes as inputs :(. For this cli tool this means, that the country info is extracted also with the short ISO code instead of the full name, but the histogram works only with the full name . The histogramming part should catch such problem at the very least or try converting ISO codes into full name at best.

Example:

$ coronapy country de -h -t cases
...
Civid-19 'cases' for last 20 day in de.
Traceback (most recent call last):
  File "xxx/anaconda3/bin/coronapy", line 10, in <module>
    sys.exit(cli())
  File "xxx/anaconda3/lib/python3.6/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "xxx/anaconda3/lib/python3.6/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "xxx/anaconda3/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "xxx/anaconda3/lib/python3.6/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "xxx/anaconda3/lib/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "xxx/anaconda3/lib/python3.6/site-packages/coronapy/cli.py", line 114, in country
    tg.chart(colors=[91, 94], data=hist_data, args=args, labels=labels_hist)
  File "xxx/anaconda3/lib/python3.6/site-packages/termgraph/termgraph.py", line 353, in chart
    len_categories = len(data[0])
IndexError: list index out of range

Used Corona-cli v1.2.3

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.