If you are a crisis response team who needs help working with this data — please contact [email protected].
VisitData.org needs volunteer programmers, data analysts, and crisis team liaisons — please contact [email protected] or visit https://github.com/VisitData-org/ca_visit_tracking.
More FAQs here: https://visitdata.org/faq
To run the app locally, in development mode:
- Obtain a Google Maps API key. If you do not have one, you can just set it to
""
and the map will be disabled. Note the API key should never be committed to the git repository. - Set up a Python virtualenv, as specified below.
- Run the server, as specified below.
- Use Chrome or Firefox as your browser - it is reported that Safari reports a CORS error in development.
To set up a virtual env:
$ python3 -m venv ~/myenv
$ source ~/myenv/bin/activate
$ pip install -r requirements.txt
To run the server in development mode:
$ export MAPS_API_KEY="..."
$ gcloud auth application-default login
$ make run
The development server will automatically refresh when files change.
Data has moved out of the repository and into Google Cloud Storage in a public bucket. You can access the latest data at https://visitdata.org/data/
- Install the Google Cloud SDK
- Run:
gsutil ls gs://data.visitdata.org
The latest data snapshot is hosted on https://visitdata.org/data/
Historic data snapshots are also hosted on https://data.visitdata.org/
For example, you can retrieve https://data.visitdata.org/processed/vendor/foursquare/asof/20200403-v0/taxonomy.json
To import new data:
-
Copy yesterday's data
$ gsutil -m cp -r gs://data.visitdata.org/processed/vendor/foursquare/asof/20200402-v0 /tmp
-
Process the new day's data by pointing to the previous day's data, the new download file and the name of the build directory to be created by the script.
$ bin/foursquare_extract.sh /tmp/20200402-v0 ~/Downloads/apr-3 /tmp/build
-
Load the processed data to the bucket
$ bin/foursquare_load.sh /tmp/build 20200403-v0
-
Modify
app.yaml
to point to the new data version$ vi app.yaml ... env_variables: FOURSQUARE_DATA_VERSION: "20200403-v0"
To deploy the app to visitdata.org:
-
Install the latest gcloud SDK: https://cloud.google.com/sdk/docs
-
Login using a Google account:
$ gcloud auth login
-
Set the default project:
$ gcloud config set project os-covid
Run:
$ cd .../ca_visit_tracking
$ make deploy-beta
Run:
$ cd .../ca_visit_tracking
$ make deploy-prod
Extract, Transform and Load (ETL) Airflow operators and DAGs in this repository
under etl/
. These can be run locally or on the production server.
See the etl/README.md
for details.