项目作者: mariuspopovici

项目描述 :
Pulls COVID-19 / Coronavirus case data from the Florida Department of Health and stores it to a MongoDb instance.
高级语言: Python
项目地址: git://github.com/mariuspopovici/COVID-19-FL.git
创建时间: 2020-03-14T02:49:59Z
项目社区:https://github.com/mariuspopovici/COVID-19-FL

开源协议:MIT License

下载


COVID-19-FL

Pulls COVID-19 / Coronavirus case data from the Florida Department of Health and stores it to a MongoDb instance.

Check out a working dashboard here.

Currently publishing embedded chart data at https://www.covid19florida.info/

Screenshot

Installation

The following instructions are for Windows 10.

Clone this repository:

git clone https://github.com/mariuspopovici/COVID-19-FL.git

Switch directory to the COVID-19-FL folder.

  1. cd COVID-19-FL

Prerequisites

Virtualenv

Install virtualenv:

  1. pip install virtualenv

Create a new virtual environment:

  1. virtualenv env

Activate the virtual environment:

  1. .\env\Scripts\activate

Install Packages

  1. pip install -r requirements.txt

Set Up MongoDB

You can download and install MongoDB locally or set up a cloud instance of MongoDB Atlas. See this video for instructions.

Also view this tutorial here.

Create a new database and two collections: florida and other_stats.
Get the cluster URL and use it to create the configuration file below.

Configure

Edit sampleconfig.json and save it as config.json in the project folder.

  1. {
  2. "mongodb": {
  3. "url": "mongodb+srv://<enter_your_mongodb_URL_here>",
  4. "database": "<database_name>"
  5. },
  6. "other": {
  7. "data_url": "http://www.floridahealth.gov/diseases-and-conditions/COVID-19/",
  8. "dashboard_url": "<analytics_dasboard_url>"
  9. },
  10. "smtp": {
  11. "user": "<your_email_address>",
  12. "password": "<your_email_password>",
  13. "email_from": "<from_email_address>",
  14. "email_to": "<to_email_address>"
  15. },
  16. "api": {
  17. "url": "https://services1.arcgis.com/CY1LXxl9zlJeBuRZ/ArcGIS/rest/services/Florida_COVID19_Case_Line_Data/FeatureServer/0/query",
  18. "daily_url": "https://covidtracking.com/api/states/daily"
  19. }
  20. }

Alternatively, you can define these configuration settings as environment variables:

  1. DATABASE_URL
  2. DATABASE_NAME
  3. DASHBOARD_URL
  4. SMTP_USER
  5. SMTP_PASSWORD
  6. EMAIL_FROM
  7. EMAIL_TO
  8. API_URL
  9. DAILY_STATS_API_URL

Run

Execute the following command to pull the latest data and store new cases in our MongoDB instance.

  1. python cv-api.py

Credits

API

Case line data can be obtained from here.