Git Product home page Git Product logo

nathanflaskproject's Introduction

Nathan's preliminary exploration of the Data Incubator's Flask on Heroku Project

The Work in Progress on Nathan's heroku that demonstrates some basic functionality.

The blog post that started this.

Forked from https://github.com/thedataincubator/flask-demo.git

This project is intended to help you tie together some important concepts and technologies from the 12-day course, including Git, Flask, JSON, Pandas, Requests, Heroku, and Bokeh for visualization.

The repository contains a basic template for a Flask configuration that will work on Heroku.

Step 1: Setup and deploy

  • Git clone the existing template repository.

  • Procfile, requirements.txt, conda-requirements.txt, and runtime.txt contain some default settings.

  • There is some boilerplate HTML in templates/

  • Create Heroku application with heroku create <app_name> or leave blank to auto-generate a name.

  • (Suggested) Use the conda buildpack. If you choose not to, put all requirements into requirements.txt

    heroku config:add BUILDPACK_URL=https://github.com/kennethreitz/conda-buildpack.git

  • Question: What are the pros and cons of using conda vs. pip?

  • Deploy to Heroku: git push heroku master

  • You should be able to see your site at https://<app_name>.herokuapp.com

  • A useful reference is the Heroku quickstart guide.

Step 2: Get data from API and put it in pandas

  • Use the requests library to grab some data from a public API. This will often be in JSON format, in which case simplejson will be useful.
  • Build in some interactivity by having the user submit a form which determines which data is requested.
  • Create a pandas dataframe with the data.

Step 3: Use Bokeh to plot pandas data

  • Create a Bokeh plot from the dataframe.
  • Consult the Bokeh documentation and examples.
  • Make the plot visible on your website through embedded HTML or other methods - this is where Flask comes in to manage the interactivity and display the desired content.
  • Some good references for Flask: This article, especially the links in "Starting off", and this tutorial.

nathanflaskproject's People

Contributors

nathanneuro avatar gotoariel avatar

Watchers

James Cloos avatar  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.