API to help make public data easier to access. Idea started with need for King County, WA COVID-19 data in API format while only having an excel file for source data.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
1.7 KiB

7 months ago
6 months ago
6 months ago
  1. # api.seattlematrix.org
  2. API to help make public data easier to access. Idea started with need for King County, WA COVID-19 data in API format while only having an excel file for source data.
  3. ## Development Setup
  4. ### Datastore
  5. I am using Postgresql for the datastore due to what I read about concurrancy over mysql, figured that would be good for an API. During development using a container on my machine.
  6. ```bash
  7. docker run --rm --name pg-docker -e POSTGRES_PASSWORD=postgres -d -p 5432:5432 -v $HOME/docker/volumes/postgres:/var/lib/postgresql/data postgres:11
  8. ```
  9. You can use this command to connect to the postgresql instance in the container.
  10. ```bash
  11. docker ps # to find the CONTAINER ID
  12. docker exec -it 05b3a3471f6f bash
  13. ```
  14. From the shell login to the db and setup initial user and database
  15. ```bash
  16. psql -U postgres
  17. ```
  18. Create your creds.py from the creds_sample.py
  19. ```bash
  20. cp creds_sample.py creds.py
  21. ```
  22. Edit creds.py with correct info for your db.
  23. More info coming soon on using the scripts in database/ to create tables and load them with data.
  24. ### Development Env.
  25. Project is using Python 3.7
  26. In the project we use [pipenv](https://pipenv.pypa.io/en/latest/) when developing.
  27. ```bash
  28. pipenv install && pipenv shell
  29. ```
  30. ### Production
  31. When running on Debian server libpq-dev is required, this is postgresl library.
  32. ```bash
  33. sudo apt-get install libpq-dev
  34. ```
  35. ### Data Available
  36. - King County, Washington COVID-19 Data
  37. - [King County, WS Covid-19 by ZipCode](https://api.seattlematrix.org/v1/kingcounty/covid-19/zipcode/all)
  38. - sample source url https://www.kingcounty.gov/depts/health/covid-19/data/~/media/depts/health/communicable-diseases/documents/C19/data/covid-data-extract-geography-august-24.ashx