Code Monkey home page Code Monkey logo

streamlit-framework's Introduction

Streamlit on Heroku

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

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

A finished example that demonstrates some basic functionality.

Step 1: Setup and deploy

  • Git clone the existing template repository.

  • Procfile, requirements.txt, and setup.py contain some default settings. If you want, you can change the email address in setup.py to your own, but it won't affect anything in the app.

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

  • 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: Plot pandas data

  • Create an interactive plot from the dataframe. Some recommended libraries: Altair, Bokeh, and Plotly.
  • Altair provides a simple interface for creating linked and layered plots. They can even be exported and embedded in static HTML (and remain fully interactive!) See the documentation and be sure to check out the example gallery.
  • Bokeh can be used in a wide range of applications, from simple charts to extensive dashboards with sophisticated backends. It's the most fully-featured library of these three, but you won't be using it for anything complicated in the Milestone Project. Here you can find the Bokeh documentation and some examples.
  • Plotly provides a range of APIs in their library. Plotly express, for instance, can be used to create commonly used plots. The Graph Objects API affords more customization, but is more complicated to use. Here is the documentation for Plotly Express.

streamlit-framework's People

Contributors

scharnk avatar mcullan avatar

Watchers

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