Streamlit Notebook : A reactive notebook interface for Streamlit

Hello !

I’m currently working on a reactive notebook interface for Streamlit. I was inspired by marimo.io and realized that something equivalent was possible leveraging Streamlit’s features.

Enables exploring data / create logic and layout dynamically using all of Streamlit’s widgets and switch to app mode (Hiding code cells) when you’re satisfied with the content.

Still a lot to be done but functional already.

You can check the repo here or try it online here.

I think its pretty cool! Hope you’ll like it!

Cheers!

Baptiste

5 Likes

Just added the possibility to upload / download notebooks as json files.
Also added an HTML cell type.

Enjoy !

1 Like

Major upgrade:

  • Introduced a custom Shell object similar to IPython in spirit, along with redirection utilities to integrate the shell smoothly in the notebook, making the python session persistent across reruns with rich display capabilities.
  • Introduced ast parsing with asttokens library to evaluate and selectively display chosen expressions on the frontend, based on the presence of a trailing semicolon.
  • Added the display function, used for rich display of data in the notebook (using st.write as a backend). Working in one-shot cells (no need to toggle auto-rerun).

Enjoy !

1 Like

Just improved the cell’s UI, which is now handled in totality by a streamlit-code-editor widget for a cleaner result.

Just improved greatly dynamic control of the notebook.

You should now be able to programmatically create, edit and run cells smoothly:

# Create a new cell and run it:
cell=notebook.new_cell(code="print('hello')",type="code") 
# type can be either "code" (default), "markdown" or "html"
cell.run()

# Edit an existing cell and run it
cell=notebook.cells[1]
cell.code="""
a=2
b=3
a+b
"""
cell.run()

I added a couple of demo notebooks to showcase these features.

Hope you enjoy !

Feeling rather lonely here, would be great to have some feedbacks ! :sweat_smile:

Cheers!