Interactive notebooks that go into depth, with links, comments, and examples including GeoJSON/choropleths and the Walk Score API. You can click the badge to play around with the code on Google Colaboratory, but without API keys some of the live data functionality won't work.
You can also view static versions on nbviewer:
A barebones Flask app that demonstrates some basic Folium functionality using the WMATA API. This exact repository is hosted on Heroku here. It takes one of the demo examples and shows how it can be delivered through a web browser. The code is meant to showcase possibilities, not best practices. Don't judge me.
The project was developed under Python 2.7 updated to Python 3.7!
- The webapp environment is specified in
requirements.txt
- You will need to have the
WMATA_KEY
environment variable set to your WMATA API key
- You will need to have the
- The demo environment is provided in
environment.yml
- You will need to put your API keys in files
demo/secrets/.wmata
anddemo/secrets/.walkscore
- You will need to put your API keys in files
You can get a temporary guest API key for WMATA.
The higher level technologies used are:
- Conda for package management
- Git for version control
- Heroku for web hosting
- Jupyter for interactive Python notebooks
See the Jupyter notebook for links to documentation relevant to the demos, including Flask, Folium, and links to the APIs used.
Option A (Suggested): Use the Python buildpack and deploy with Git.
Option B: If you end up needing a lot of packages or want to use Conda, you can try deploying with Docker.
- Download the Heroku CLI and sign in with
heroku login
. - Create a Heroku application with
heroku create <app_name> --buildpack heroku/python
or leave the name blank to auto-generate one. - Make a
requirements.txt
file with all dependencies for the app. - Make a
runtime.txt
file that specifies the Python runtime version, eg.python-3.7.1
. - Make a
Procfile
that has eg.web: gunicorn --pythonpath . tracker --log-file=-
. - Deploy the repo to Heroku by
git push heroku master
. You should be able to access your app athttps://<app_name>.herokuapp.com
.
There is a quickstart guide available as a reference.
heroku logs
can display remote logs from your app, however heroku local
will run the app at localhost:5000
and will be more useful for debugging.
- Remember to put WMATA_KEY in the environment
- The app will need to reach the public internet for geocoding