Code Monkey home page Code Monkey logo

folium-demo's Introduction

Summary

demo/

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.

Open In Colab

You can also view static versions on nbviewer:

tracker/

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.

Environment

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
  • The demo environment is provided in environment.yml
    • You will need to put your API keys in files demo/secrets/.wmata and demo/secrets/.walkscore

You can get a temporary guest API key for WMATA.

References

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.

Heroku quickstart

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.

  1. Download the Heroku CLI and sign in with heroku login.
  2. Create a Heroku application with heroku create <app_name> --buildpack heroku/python or leave the name blank to auto-generate one.
  3. Make a requirements.txt file with all dependencies for the app.
  4. Make a runtime.txt file that specifies the Python runtime version, eg. python-3.7.1.
  5. Make a Procfile that has eg. web: gunicorn --pythonpath . tracker --log-file=-.
  6. Deploy the repo to Heroku by git push heroku master. You should be able to access your app at https://<app_name>.herokuapp.com.

There is a quickstart guide available as a reference.

Debugging

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

Relevant links

folium-demo's People

Contributors

gotoariel avatar

Watchers

 avatar

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.