Make Streamlit more awesome in Atom


License
Apache-2.0
Install
apm install streamlit-atom@2.0.4

Documentation

Streamlit Atom package

This is an Atom package that sets up Streamlit integration, so you can run Streamlit scripts and see reports in a side pane right next to the file you're editing. This way you don't have to constantly shuffle between Atom, the terminal, a web browser :D

Local usage

When editing a local Python script that uses Streamlit, just press ctrl-alt-r, select Local profile, and watch the magic happen.

What this does:

  1. It runs your script
  2. Then it opens a side pane with the resulting Streamlit report.

From now on, you can just edit your script in Atom normally, and every time you save the file the Streamlit report will automatically update. No need to press ctrl-alt-r again!

NOTE: If you use Anaconda or Pyenv, you may need to update the Streamlit Atom settings for ctrl-alt-r to work for you. See the Settings section below.

Remote usage

When editing a remote Python script that uses Streamlit, you first need to go through a few extra steps as a one-time setup:

  1. First of all, we assume you already have remote editing set up in Atom. Personally, I find SHFS to be the best way to do this:

    # On Mac OS
    $ brew cask install osxfuse
    $ brew install sshfs
    
    # On Ubuntu
    $ sudo apt-get install sshfs
  2. In Atom on your local machine, press ctrl-shift-P (cmd-shift-P on a Mac), and type Streamlit Profile Editor.

  3. Select Remote profile in the top selectbox.

  4. Set up the fields Streamlit proxy URL, Remote machine, Remote folder, and Local path where remote folder is mounted. See the on-screen documentation for that.

  5. Open your remote .py file in Atom as you normally would (see SSHFS instructions, for example).

  6. Still in Atom, go back to the remote file you're editing and press ctrl-alt-r, then choose Remote profile to run your file remotely and open the Streamlit report in a side pane!

From now on, you can just edit your remote script in Atom normally, and every time you save the file the Streamlit report will automatically update.