Giter Site home page Giter Site logo

ramonssouza / chile-coronavirus Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sundios/chile-coronavirus

0.0 0.0 0.0 3.04 MB

Scraping and analyzing corona virus data from minsal.cl.

Home Page: https://datastudio.google.com/reporting/f97733c1-17e1-4bd6-8841-9dd2d45ac9b4/page/W3OJB/

Python 100.00%

chile-coronavirus's Introduction

Corona Virus in Chile

Daily Chile Corona virus data pipeline. Data is scraped daily from misal.cl

Live Dashboard

All the data gathered is pushed to a live dashoboard that you can find here

Daily Chile cases

Requirements.txt

pygsheets==2.0.3.1
matplotlib==3.2.1
beautifulsoup4==4.9.0
pandas==1.0.3
numpy==1.18.2

Sources

PipeLine

To scrape the minsal and the worldometers data I built a pipline using airflow that consists in 5 tasks that run 3 different scripts. Each of the script pushes data to a Google spreadsheet. I wanted to use google spreadhseet since the data is not that heavy and its easy to connect google sheets. with data studio.

The pipline is set to run every day at 11:05AM CLT. Since airflow uses Directed acyclic graphs I cant re run a task, so I created a while loop as the first task that keeps runing until the condition is true.

The task are:

  1. Minsal_check: scrapes the site and compares the current data with a while loop with yesterday's data. If data is the same than yesterday then the while loops keeps running until the data has been updated and we can proceed with out pipeline.
  2. Continue_task: echo a message that tell us that data has been change.
  3. Scraping Data
    1. Scrape_Minsal_data: Scrape new minsal data,clean the data, Create daily csv and push it to g oogle sheets
    2. Scrape_Regiones_Data: We open all files from the minsal data we scraped and concatenate all of them in one file, then we do some cleaning and output all different regions by totals. We push these into different worksheets in google sheets.
    3. Scrape_Paises_data: Scrape new data from Worldometer and then only select southamerican countries and push it to google sheets.
  4. finish_task: echo task is finished

Graph View

chile-coronavirus's People

Contributors

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