Giter Club home page Giter Club logo

testing-streamlit-mybinder's Introduction

Binder


testing-streamlit-mybinder

A repo tryna see if you could run a streamlit app on mybinder

Inspired by this thread: https://discuss.streamlit.io/t/jupyterhub-streamlit/1238/5

It finally worked when github user op07n forked and fixed streamlit_call.py

Requirements

3 files:

  • requirements.txt or evironment.yml with
    • nbserverproxy
    • streamlit
    • jupyter-server-proxy
  • a jupyter server extension script:
    • Here we called it streamlit_call.py and it's fairly simple
    from subprocess import Popen
    
    def load_jupyter_server_extension(nbapp):
        """serve the streamlit app"""
        Popen(["streamlit", "hello", "--browser.serverAddress=0.0.0.0", "--server.enableCORS=False"])
  • postBuild which enables nbserverproxy, moves the extension script and enables it
      # enable nbserverproxy
      jupyter serverextension enable --sys-prefix nbserverproxy
      # streamlit launches at startup
      mv .binder/streamlit_call.py ${NB_PYTHON_PREFIX}/lib/python*/site-packages/
      # enable streamlit extension
      jupyter serverextension enable --sys-prefix streamlit_call

To open by default you'd add ?urlpath=proxy/8501/ to the end of your mybinder link. For example, this repo's link is https://mybinder.org/v2/gh/chekos/testing-streamlit-mybinder/master?urlpath=proxy/8501/

WARNING: Make sure you have a trailing / at the end (proxy/8501/ ๐Ÿ‘ - proxy/8501 ๐Ÿ‘Ž)

testing-streamlit-mybinder's People

Contributors

chekos 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.