GithubHelp home page GithubHelp logo

joshrotenberg / covid_19_nyt_ex Goto Github PK

View Code? Open in Web Editor NEW
5.0 3.0 1.0 1.61 MB

GraphQL/REST access to The NY Times Covid19 US Data

Home Page: https://still-sea-82556.herokuapp.com/gql

Elixir 81.10% CSS 12.12% JavaScript 4.25% HTML 2.53%
covid-19 coronavirus nytimes rest graphql elixir phoenix-framework

covid_19_nyt_ex's Introduction

Covid19 Data

Codeship Status for joshrotenberg/covid_19_nyt_ex

This is a Phoenix application that exposes the data from the New York Times Coronavirus (Covid-19) Data in the United States data set. This is “Data from The New York Times, based on reports from state and local health agencies.” For more information, see their tracking page.

Warning, Disclaimer, etc.

This is not my data. I do not work for The New York Times. I do not have any control over the data itself, nor can I vouch for its accuracy. If you have any questions or concerns with the data please see the contact info in their GitHub repository.

Endpoints

This project is currently live on Heroku, with the following endpoints available (more to follow):

Screenshot

Image of Playground

Status

This is a hobby project and is a work in progress, therefore it may be broken or incomplete at times. If you happen to find this useful or have any suggestions or problems, please let me know, file an issue, contribute, etc.

Tech stuff

This is a Phoenix project written in Elixir. It uses Absinthe for GraphQL.

Data

The data sets are two CSV files. They are pulled via HTTP hourly, parsed and loaded into a Postgres database. The data model is simple and mirrors that of each data set. The two sets are completely independent. The HTTP ETag is respected so that file are only pulled and parsed if they've changed since the last pull (or last app tartup since the ETag data is stored in memory). As of today, it looks like the files are updated daily, sometimes several times to fix incorrect data, so an hourly pull should keep this application's data fresh.

Because each data point represents a single day's numbers (Covid19 cases and deaths per day per state or county), the data is continually growing and periodically adjusted to reflect new information. To model this on the database side, rows have a unique constraint on the date and state (and county for county data) so that revised data is fixed rather than added.

TODO

  • the CSV parsing pipelines could be more dry, lots of repeated code
  • docs in the code
  • tests
  • configify the CSV urls and make local endpoints to serve for testing and development

Running locally

To start your Phoenix server:

  • Install dependencies with mix deps.get
  • Create and migrate your database with mix ecto.setup
  • Install Node.js dependencies with cd assets && npm install
  • Start Phoenix endpoint with mix phx.server

Now you can visit localhost:4000 from your browser.

Ready to run in production? Please check our deployment guides.

Learn more

covid_19_nyt_ex's People

Contributors

dependabot[bot] avatar joshraexp avatar joshrotenberg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

jltml

covid_19_nyt_ex's Issues

County data hasn't updated since October 31st

Hi there! I've just created a pull request for a typo, so sorry about having another thing... anyway, I noticed that all county data hasn't updated since October 31st? The last entry here, for example, is from 2020-10-31, while the last entry for the whole state (here) is from 2021-02-13 (two days ago). Just thought I should let you know — I don't really know how any of this project works, so I don't know what's wrong, but I could always try to figure it out myself sometime. Thanks!

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.