Write Streamlit apps using Notion! (Prototype)

Overview

Streamlit + Notion test app

Write Streamlit apps using Notion!

☠️ IMPORTANT: This is just a little prototype I made to play with some ideas. Not meant for production!

Forking instructions

  1. Fork this app into your own repo (or just copy streamlit_app.py. It's fully self-contained!)

  2. Create a new integration in Notion. When you're done, grab the secret token as you'll need it later.

  3. Create a page in Notion, then:

    1. Share it with your integration
    2. Grab the page URL as you'llneed it later.
  4. Deploy your app with share.streamlit.io.

  5. Set up your app's secrets, adding in the secret token and page URL from the steps above.

    [notion]
    token = "YOUR_NOTION_SECRET"
    page_url = "YOUR_NOTION_PAGE_URL"
    

🥳 Done!

Now any time you edit your Notion page, go into your Streamlit app and press R to rerun it (thereby fetching the latest content from Notion).

But wait, there's more!

If you add a code block in Notion and mark it as a Python block, it will actually get executed when you load your app!

So try adding a Python block with this into your Notion page:

import streamlit as st
import numpy as np

num_rows = st.slider("Number of rows", 1, 500, 100)
data = np.random.randn(num_rows, 5)

st.write(data)
st.line_chart(data)

(If you need other Python packages, add them to your requirements.txt)

One more thing: let's say you want to execute Python code, but don't want to polute your Notion page with too much ugly code. There's a hack for that. Just put the code inside an expander without a title.

What's supported

  • Headers
  • Paragraphs (with bold/italic/strikethrough/links)
  • Images
  • Code blocks
  • Expanders

And that's all ☹️

Again, this is just a proof-of-concept / prototype. So I didn't implement a bunch of other stuff, like underline, @mentions, columns, etc.

Also note that not everything in Streamlit is supported either. I don't have an exhaustive list but, for example, magic doesn't work.

You might also like...
sawa (ꦱꦮ) is an open source programming language, an interpreter to be precise, where you can write python code using javanese character.
sawa (ꦱꦮ) is an open source programming language, an interpreter to be precise, where you can write python code using javanese character.

ꦱꦮ sawa (ꦱꦮ) is an open source programming language, an interpreter to be precise, where you can write python code using javanese character. sawa iku

Create standalone, installable R Shiny apps using Electron

Create standalone, installable R Shiny apps using Electron

Create standalone, installable R Shiny apps using Electron

WARNING This is still very much a work in progress and nothing can be assumed stable in any way Temp notes: Two types of created installer, based on w

OpenSea NFT API App using Python and Streamlit

opensea-nft-api-tutorial OpenSea NFT API App using Python and Streamlit Tutorial Video Walkthrough https://www.youtube.com/watch?v=49SupvcFC1M Instruc

Write complicated anonymous functions other than lambdas in Python.

lambdex allows you to write multi-line anonymous function expression (called a lambdex) in an idiomatic manner.

This is a modified variation of abhiTronix's vidgear. In this variation, it is possible to write the output file anywhere regardless the permissions.
This is a modified variation of abhiTronix's vidgear. In this variation, it is possible to write the output file anywhere regardless the permissions.

Info In order to download this package: Windows 10: Press Windows+S, Type PowerShell (cmd in older versions) and hit enter, Type pip install vidgear_n

Why write code when you can import it directly from GitHub Copilot?

Copilot Importer Why write code when you can import it directly from GitHub Copilot? What is Copilot Importer? The copilot python module will dynamica

An extension for Arma 3 that lets you write extensions in Python 3
An extension for Arma 3 that lets you write extensions in Python 3

An Arma 3 extension that lets you to write python extensions for Arma 3. And it's really simple and straightforward to use!

Generate Openbox Menus from a easy to write configuration file.

openbox-menu-generator Generate Openbox Menus from a easy to write configuration file. Example Configuration: ('#' indicate comments but not implement

Comments
Owner
Thiago Teixeira
co-founder @ Streamlit
Thiago Teixeira
Streamlit apps done following data professor's course on YouTube

streamlit-twelve-apps Streamlit apps done following data professor's course on YouTube Español Curso de apps de data science hecho por Data Professor

Federico Bravin 1 Jan 10, 2022
Streamlit component to display topics from Streamlit's community forum related to any exception.

streamlit-forum Streamlit component to display topics from Streamlit's community forum related to any exception. Installation pip install streamlit-fo

Snehan Kekre 7 Jul 15, 2022
Architectural Patterns implementation by using notification handler module prototype

This repository covers singleton, indirection, factory, adaptor, mediator patterns in python language by using university hypothetical notification module prototype. The code is just for demonstrating the pattern implementation not modules working

Muhammad Umair 2 Jan 8, 2022
2 Way Sync Between Notion Database and Google Calendar

Notion-and-Google-Calendar-2-Way-Sync 2 Way Sync Between a Notion Database and Google Calendar WARNING: This repo will be undergoing a good bit of cha

null 248 Dec 26, 2022
This an Anki add on that automatically converts Notion notes into Anki flash cards. Currently in development!

NotionFlash This is an Anki add on in development that will allow automatically convert your Notion study notes into Anki flash cards. The Anki deck c

Neeraj Patel 10 Oct 7, 2022
Prototype application for GCM bias-correction and downscaling

dodola Prototype application for GCM bias-correction and downscaling This is an unstable prototype. This is under heavy development. Features Nothing!

Climate Impact Lab 9 Dec 27, 2022
Developing a python based app prototype with KivyMD framework for a competition :))

Developing a python based app prototype with KivyMD framework for a competition :))

Jay Desale 1 Jan 10, 2022
Terminal compatible with ansi-bbs. Meant to be a prototype, but published because why not.

pybbsterm: Terminal emulator for calling BBSs. Use cases (non-exhaustive) Explore terminal protocols. Connect to BBSs. Highlights Python 3.8+ code. Bu

Roc Vallès i Domènech 9 Apr 29, 2022
A prototype COG-based tile server for sparse Mars datasets

Mars tiler Mars Tiler is a prototype web application that serves tiles from cloud-optimized GeoTIFFs, with an emphasis on supporting planetary dataset

Daven Quinn 3 Mar 23, 2022