Git Product home page Git Product logo

pscovid-19's Introduction

ReadMe

Build Status

PSCOVID-19

This was a project born out of wanting to just write some code as more cases of COVID-19 started popping up throughout the United States.

This uses the same CSV data files in the Johns Hopkins CSSE GitHub Repository. This is a side project I just wanted to write to tinker with data, I am in NO WAY affiliated with any health organization or Johns Hopkins!

Install and Usage

Installing the module.

# Install module.
Install-Module -Name PSCOVID-19 -Scope CurrentUser

As of now the module only has limited functionality.

If you want to get all of the data to manipulate it yourself. Use Get-COVID19Data, it will return a list of [Covid] objects that you can manipulate with built-in PowerShell Cmdlets.

# Gather the latest data
$covidData = Get-COVID19Data

# Filter the data to get all US cases and measure the total amount of confirmed cases across all of the data
$covidData | Where-Object {$_.CountryOrRegion -eq 'US'} | Measure-Object -Property Confirmed -Sum

# For you other New Englanders, Get all the New England states, sort by 'confirmed' cases and then format it out as a table
$covidData | Where-Object {$_.CountryOrRegion -eq 'US'} | Where-Object {
    $_.ProvinceOrState -eq 'Massachusetts' -or
    $_.ProvinceOrState -eq 'Rhode Island' -or
    $_.ProvinceOrState -eq 'Connecticut' -or
    $_.ProvinceOrState -eq 'New Hampshire' -or
    $_.ProvinceOrState -eq 'Vermont' -or
    $_.ProvinceOrState -eq 'Maine'
} | Sort-Object -Property Confirmed -Descending | Format-Table -AutoSize

# Get data for Italy
$covidData | Where-Object {$_.CountryOrRegion -eq 'Italy'}  | Format-Table -AutoSize

# Use Measure-Object to get stats for a given area
$covidData | Where-Object {$_.ProvinceOrState -eq 'New York'}  | Measure-Object -Property Confirmed -AllStats

As the data only tends to update once daily this originally was a tracker in pre 2.* versions. Now Format-Covid19Table simply prints the data with a pretty table that has colors!

# Get all United States cases
Format-Covid19Table -CountryOrRegion US

# Get all the cases for a specific state
Format-Covid19Table -CountryOrRegion US -ProvinceOrState 'Massachusetts'

Below is an image of the output using the US and Massachusetts as an example. example1

Links

pscovid-19's People

Contributors

ephos 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.