Spaces:
Sleeping
Sleeping
build details on every page
Browse files- nb/prod_data.py +1 -1
- nb/prod_files.py +1 -1
- nb/prod_home.py +3 -4
- nb/prod_marimo.py +1 -1
- pyproject.toml +1 -1
- src/marimo_apps.py +18 -17
nb/prod_data.py
CHANGED
|
@@ -108,7 +108,7 @@ def _(UI, df2, mo, ptable):
|
|
| 108 |
|
| 109 |
dashboard = mo.vstack([md, ptable])
|
| 110 |
|
| 111 |
-
mo.hstack([UI.NAV, dashboard], widths=[1, 5])
|
| 112 |
return
|
| 113 |
|
| 114 |
|
|
|
|
| 108 |
|
| 109 |
dashboard = mo.vstack([md, ptable])
|
| 110 |
|
| 111 |
+
mo.hstack([UI.NAV, dashboard, UI.BUILD_DETAILS], widths=[1, 5])
|
| 112 |
return
|
| 113 |
|
| 114 |
|
nb/prod_files.py
CHANGED
|
@@ -20,7 +20,7 @@ def _(UI, mo):
|
|
| 20 |
## File Browser
|
| 21 |
""")
|
| 22 |
|
| 23 |
-
mo.hstack([UI.NAV, md], widths=[1, 5])
|
| 24 |
return
|
| 25 |
|
| 26 |
|
|
|
|
| 20 |
## File Browser
|
| 21 |
""")
|
| 22 |
|
| 23 |
+
mo.hstack([UI.NAV, md, UI.BUILD_DETAILS], widths=[1, 5])
|
| 24 |
return
|
| 25 |
|
| 26 |
|
nb/prod_home.py
CHANGED
|
@@ -14,12 +14,13 @@ def _():
|
|
| 14 |
sys.path.append(ROOT.as_posix())
|
| 15 |
|
| 16 |
from src.marimo_apps import UI
|
|
|
|
| 17 |
return UI, mo
|
| 18 |
|
| 19 |
|
| 20 |
@app.cell
|
| 21 |
def _(UI, mo):
|
| 22 |
-
md = mo.md(
|
| 23 |
# Yes, Notebooks In Production | PyCon 2026
|
| 24 |
|
| 25 |
### Description
|
|
@@ -52,11 +53,9 @@ def _(UI, mo):
|
|
| 52 |
[02:15 - 02:30] Deployment and monitoring
|
| 53 |
[02:30 - 03:00] Q&A + optional Task 5: build your own
|
| 54 |
|
| 55 |
-
/// details | Build details
|
| 56 |
-
{UI.VERSION}
|
| 57 |
""")
|
| 58 |
|
| 59 |
-
mo.hstack([UI.NAV, md], widths=[1, 5])
|
| 60 |
return
|
| 61 |
|
| 62 |
|
|
|
|
| 14 |
sys.path.append(ROOT.as_posix())
|
| 15 |
|
| 16 |
from src.marimo_apps import UI
|
| 17 |
+
|
| 18 |
return UI, mo
|
| 19 |
|
| 20 |
|
| 21 |
@app.cell
|
| 22 |
def _(UI, mo):
|
| 23 |
+
md = mo.md("""
|
| 24 |
# Yes, Notebooks In Production | PyCon 2026
|
| 25 |
|
| 26 |
### Description
|
|
|
|
| 53 |
[02:15 - 02:30] Deployment and monitoring
|
| 54 |
[02:30 - 03:00] Q&A + optional Task 5: build your own
|
| 55 |
|
|
|
|
|
|
|
| 56 |
""")
|
| 57 |
|
| 58 |
+
mo.hstack([UI.NAV, md, UI.BUILD_DETAILS], widths=[1, 5])
|
| 59 |
return
|
| 60 |
|
| 61 |
|
nb/prod_marimo.py
CHANGED
|
@@ -20,7 +20,7 @@ def _(UI, mo):
|
|
| 20 |
## Marimo Features
|
| 21 |
""")
|
| 22 |
|
| 23 |
-
mo.hstack([UI.NAV, md], widths=[1, 5])
|
| 24 |
return
|
| 25 |
|
| 26 |
|
|
|
|
| 20 |
## Marimo Features
|
| 21 |
""")
|
| 22 |
|
| 23 |
+
mo.hstack([UI.NAV, md, UI.BUILD_DETAILS], widths=[1, 5])
|
| 24 |
return
|
| 25 |
|
| 26 |
|
pyproject.toml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
[project]
|
| 2 |
name = "marimo-on-fastapi"
|
| 3 |
-
version = "0.1.
|
| 4 |
description = "Add your description here"
|
| 5 |
readme = "README.md"
|
| 6 |
requires-python = ">=3.13"
|
|
|
|
| 1 |
[project]
|
| 2 |
name = "marimo-on-fastapi"
|
| 3 |
+
version = "0.1.1"
|
| 4 |
description = "Add your description here"
|
| 5 |
readme = "README.md"
|
| 6 |
requires-python = ">=3.13"
|
src/marimo_apps.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
import typing as t
|
| 2 |
from collections import OrderedDict
|
| 3 |
-
from marimo import create_asgi_app, nav_menu
|
| 4 |
from pathlib import Path
|
| 5 |
|
| 6 |
from .log import logger
|
|
@@ -11,21 +11,6 @@ NB_FOLDER = Path(__file__).parent.parent / "nb"
|
|
| 11 |
logger.info(f"NB_FOLDER: {NB_FOLDER}")
|
| 12 |
|
| 13 |
|
| 14 |
-
def get_versions() -> str:
|
| 15 |
-
from duckdb import __version__ as duckdb_version
|
| 16 |
-
from fastapi import __version__ as fastapi_version
|
| 17 |
-
from marimo import __version__ as marimo_version
|
| 18 |
-
from sys import version as python_version
|
| 19 |
-
|
| 20 |
-
versions = f"""
|
| 21 |
-
marimo: {marimo_version}
|
| 22 |
-
FastAPI: {fastapi_version}
|
| 23 |
-
DuckDB: {duckdb_version}
|
| 24 |
-
python: {python_version}
|
| 25 |
-
"""
|
| 26 |
-
return versions
|
| 27 |
-
|
| 28 |
-
|
| 29 |
class MarimoApps:
|
| 30 |
def __init__(self, folder: Path = NB_FOLDER):
|
| 31 |
self.folder = folder
|
|
@@ -50,6 +35,22 @@ class MarimoApps:
|
|
| 50 |
apps = apps.with_app(path=endpoint, root=path)
|
| 51 |
return apps.build()
|
| 52 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
|
| 54 |
marimo_apps = MarimoApps()
|
| 55 |
# print(marimo_apps.pages)
|
|
@@ -58,4 +59,4 @@ marimo_apps = MarimoApps()
|
|
| 58 |
class UI:
|
| 59 |
TITLE = "Marimo on FastAPI"
|
| 60 |
NAV = nav_menu(marimo_apps.pages, orientation="vertical").style(font_size="20px")
|
| 61 |
-
|
|
|
|
| 1 |
import typing as t
|
| 2 |
from collections import OrderedDict
|
| 3 |
+
from marimo import create_asgi_app, md, nav_menu
|
| 4 |
from pathlib import Path
|
| 5 |
|
| 6 |
from .log import logger
|
|
|
|
| 11 |
logger.info(f"NB_FOLDER: {NB_FOLDER}")
|
| 12 |
|
| 13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
class MarimoApps:
|
| 15 |
def __init__(self, folder: Path = NB_FOLDER):
|
| 16 |
self.folder = folder
|
|
|
|
| 35 |
apps = apps.with_app(path=endpoint, root=path)
|
| 36 |
return apps.build()
|
| 37 |
|
| 38 |
+
def build_details(self) -> str:
|
| 39 |
+
from duckdb import __version__ as duckdb_version
|
| 40 |
+
from fastapi import __version__ as fastapi_version
|
| 41 |
+
from marimo import __version__ as marimo_version
|
| 42 |
+
from sys import version as python_version
|
| 43 |
+
|
| 44 |
+
versions = md(f"""/// details | Build details
|
| 45 |
+
marimo: {marimo_version}
|
| 46 |
+
FastAPI: {fastapi_version}
|
| 47 |
+
DuckDB: {duckdb_version}
|
| 48 |
+
python: {python_version}
|
| 49 |
+
///
|
| 50 |
+
""")
|
| 51 |
+
|
| 52 |
+
return versions
|
| 53 |
+
|
| 54 |
|
| 55 |
marimo_apps = MarimoApps()
|
| 56 |
# print(marimo_apps.pages)
|
|
|
|
| 59 |
class UI:
|
| 60 |
TITLE = "Marimo on FastAPI"
|
| 61 |
NAV = nav_menu(marimo_apps.pages, orientation="vertical").style(font_size="20px")
|
| 62 |
+
BUILD_DETAILS = marimo_apps.build_details()
|