Spaces:
Sleeping

dnom commited on
Commit
34b8916
·
unverified ·
0 Parent(s):

Initial commit

Browse files
.github/renovate.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "extends": [
3
+ "config:recommended",
4
+ ":enablePreCommit",
5
+ ":dependencyDashboard",
6
+ ":semanticCommits",
7
+ ":pinVersions"
8
+ ],
9
+ "enabledManagers": [
10
+ "github-actions"
11
+ ]
12
+ }
.github/scripts/build.py ADDED
@@ -0,0 +1,227 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ Build script for marimo notebooks.
3
+
4
+ This script exports marimo notebooks to HTML/WebAssembly format and generates
5
+ an index.html file that lists all the notebooks. It handles both regular notebooks
6
+ (from the notebooks/ directory) and apps (from the apps/ directory).
7
+
8
+ The script can be run from the command line with optional arguments:
9
+ uv run .github/scripts/build.py [--output-dir OUTPUT_DIR]
10
+
11
+ The exported files will be placed in the specified output directory (default: _site).
12
+ """
13
+
14
+ # /// script
15
+ # requires-python = ">=3.12"
16
+ # dependencies = [
17
+ # "jinja2==3.1.3",
18
+ # "fire==0.7.0",
19
+ # "loguru==0.7.0"
20
+ # ]
21
+ # ///
22
+
23
+ import subprocess
24
+ from typing import List, Union
25
+ from pathlib import Path
26
+
27
+ import jinja2
28
+ import fire
29
+
30
+ from loguru import logger
31
+
32
+ def _export_html_wasm(notebook_path: Path, output_dir: Path, as_app: bool = False) -> bool:
33
+ """Export a single marimo notebook to HTML/WebAssembly format.
34
+
35
+ This function takes a marimo notebook (.py file) and exports it to HTML/WebAssembly format.
36
+ If as_app is True, the notebook is exported in "run" mode with code hidden, suitable for
37
+ applications. Otherwise, it's exported in "edit" mode, suitable for interactive notebooks.
38
+
39
+ Args:
40
+ notebook_path (Path): Path to the marimo notebook (.py file) to export
41
+ output_dir (Path): Directory where the exported HTML file will be saved
42
+ as_app (bool, optional): Whether to export as an app (run mode) or notebook (edit mode).
43
+ Defaults to False.
44
+
45
+ Returns:
46
+ bool: True if export succeeded, False otherwise
47
+ """
48
+ # Convert .py extension to .html for the output file
49
+ output_path: Path = notebook_path.with_suffix(".html")
50
+
51
+ # Base command for marimo export
52
+ cmd: List[str] = ["uvx", "marimo", "export", "html-wasm", "--sandbox"]
53
+
54
+ # Configure export mode based on whether it's an app or a notebook
55
+ if as_app:
56
+ logger.info(f"Exporting {notebook_path} to {output_path} as app")
57
+ cmd.extend(["--mode", "run", "--no-show-code"]) # Apps run in "run" mode with hidden code
58
+ else:
59
+ logger.info(f"Exporting {notebook_path} to {output_path} as notebook")
60
+ cmd.extend(["--mode", "edit"]) # Notebooks run in "edit" mode
61
+
62
+ try:
63
+ # Create full output path and ensure directory exists
64
+ output_file: Path = output_dir / notebook_path.with_suffix(".html")
65
+ output_file.parent.mkdir(parents=True, exist_ok=True)
66
+
67
+ # Add notebook path and output file to command
68
+ cmd.extend([str(notebook_path), "-o", str(output_file)])
69
+
70
+ # Run marimo export command
71
+ logger.debug(f"Running command: {cmd}")
72
+ subprocess.run(cmd, capture_output=True, text=True, check=True)
73
+ logger.info(f"Successfully exported {notebook_path}")
74
+ return True
75
+ except subprocess.CalledProcessError as e:
76
+ # Handle marimo export errors
77
+ logger.error(f"Error exporting {notebook_path}:")
78
+ logger.error(f"Command output: {e.stderr}")
79
+ return False
80
+ except Exception as e:
81
+ # Handle unexpected errors
82
+ logger.error(f"Unexpected error exporting {notebook_path}: {e}")
83
+ return False
84
+
85
+
86
+ def _generate_index(output_dir: Path, template_file: Path, notebooks_data: List[dict] | None = None, apps_data: List[dict] | None = None) -> None:
87
+ """Generate an index.html file that lists all the notebooks.
88
+
89
+ This function creates an HTML index page that displays links to all the exported
90
+ notebooks. The index page includes the marimo logo and displays each notebook
91
+ with a formatted title and a link to open it.
92
+
93
+ Args:
94
+ notebooks_data (List[dict]): List of dictionaries with data for notebooks
95
+ apps_data (List[dict]): List of dictionaries with data for apps
96
+ output_dir (Path): Directory where the index.html file will be saved
97
+ template_file (Path, optional): Path to the template file. If None, uses the default template.
98
+
99
+ Returns:
100
+ None
101
+ """
102
+ logger.info("Generating index.html")
103
+
104
+ # Create the full path for the index.html file
105
+ index_path: Path = output_dir / "index.html"
106
+
107
+ # Ensure the output directory exists
108
+ output_dir.mkdir(parents=True, exist_ok=True)
109
+
110
+ try:
111
+ # Set up Jinja2 environment and load template
112
+ template_dir = template_file.parent
113
+ template_name = template_file.name
114
+ env = jinja2.Environment(
115
+ loader=jinja2.FileSystemLoader(template_dir),
116
+ autoescape=jinja2.select_autoescape(["html", "xml"])
117
+ )
118
+ template = env.get_template(template_name)
119
+
120
+ # Render the template with notebook and app data
121
+ rendered_html = template.render(notebooks=notebooks_data, apps=apps_data)
122
+
123
+ # Write the rendered HTML to the index.html file
124
+ with open(index_path, "w") as f:
125
+ f.write(rendered_html)
126
+ logger.info(f"Successfully generated index.html at {index_path}")
127
+
128
+ except IOError as e:
129
+ # Handle file I/O errors
130
+ logger.error(f"Error generating index.html: {e}")
131
+ except jinja2.exceptions.TemplateError as e:
132
+ # Handle template errors
133
+ logger.error(f"Error rendering template: {e}")
134
+
135
+
136
+ def _export(folder: Path, output_dir: Path, as_app: bool=False) -> List[dict]:
137
+ """Export all marimo notebooks in a folder to HTML/WebAssembly format.
138
+
139
+ This function finds all Python files in the specified folder and exports them
140
+ to HTML/WebAssembly format using the export_html_wasm function. It returns a
141
+ list of dictionaries containing the data needed for the template.
142
+
143
+ Args:
144
+ folder (Path): Path to the folder containing marimo notebooks
145
+ output_dir (Path): Directory where the exported HTML files will be saved
146
+ as_app (bool, optional): Whether to export as apps (run mode) or notebooks (edit mode).
147
+
148
+ Returns:
149
+ List[dict]: List of dictionaries with "display_name" and "html_path" for each notebook
150
+ """
151
+ # Check if the folder exists
152
+ if not folder.exists():
153
+ logger.warning(f"Directory not found: {folder}")
154
+ return []
155
+
156
+ # Find all Python files recursively in the folder
157
+ notebooks = list(folder.rglob("*.py"))
158
+ logger.debug(f"Found {len(notebooks)} Python files in {folder}")
159
+
160
+ # Exit if no notebooks were found
161
+ if not notebooks:
162
+ logger.warning(f"No notebooks found in {folder}!")
163
+ return []
164
+
165
+ # For each successfully exported notebook, add its data to the notebook_data list
166
+ notebook_data = [
167
+ {
168
+ "display_name": (nb.stem.replace("_", " ").title()),
169
+ "html_path": str(nb.with_suffix(".html")),
170
+ }
171
+ for nb in notebooks
172
+ if _export_html_wasm(nb, output_dir, as_app=as_app)
173
+ ]
174
+
175
+ logger.info(f"Successfully exported {len(notebook_data)} out of {len(notebooks)} files from {folder}")
176
+ return notebook_data
177
+
178
+ def main(
179
+ output_dir: Union[str, Path] = "_site",
180
+ template: Union[str, Path] = "templates/tailwind.html.j2",
181
+ ) -> None:
182
+ """Main function to export marimo notebooks.
183
+
184
+ This function:
185
+ 1. Parses command line arguments
186
+ 2. Exports all marimo notebooks in the 'notebooks' and 'apps' directories
187
+ 3. Generates an index.html file that lists all the notebooks
188
+
189
+ Command line arguments:
190
+ --output-dir: Directory where the exported files will be saved (default: _site)
191
+ --template: Path to the template file (default: templates/index.html.j2)
192
+
193
+ Returns:
194
+ None
195
+ """
196
+ logger.info("Starting marimo build process")
197
+
198
+ # Convert output_dir explicitly to Path (not done by fire)
199
+ output_dir: Path = Path(output_dir)
200
+ logger.info(f"Output directory: {output_dir}")
201
+
202
+ # Make sure the output directory exists
203
+ output_dir.mkdir(parents=True, exist_ok=True)
204
+
205
+ # Convert template to Path if provided
206
+ template_file: Path = Path(template)
207
+ logger.info(f"Using template file: {template_file}")
208
+
209
+ # Export notebooks from the notebooks/ directory
210
+ notebooks_data = _export(Path("notebooks"), output_dir, as_app=False)
211
+
212
+ # Export apps from the apps/ directory
213
+ apps_data = _export(Path("apps"), output_dir, as_app=True)
214
+
215
+ # Exit if no notebooks or apps were found
216
+ if not notebooks_data and not apps_data:
217
+ logger.warning("No notebooks or apps found!")
218
+ return
219
+
220
+ # Generate the index.html file that lists all notebooks and apps
221
+ _generate_index(output_dir=output_dir, notebooks_data=notebooks_data, apps_data=apps_data, template_file=template_file)
222
+
223
+ logger.info(f"Build completed successfully. Output directory: {output_dir}")
224
+
225
+
226
+ if __name__ == '__main__':
227
+ fire.Fire(main)
.github/workflows/deploy.yml ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This workflow builds and deploys marimo notebooks to GitHub Pages
2
+ # It runs automatically when changes are pushed to the main branch or can be triggered manually
3
+
4
+ name: Deploy to GitHub Pages
5
+
6
+ # Defines when the workflow will run
7
+ on:
8
+ push:
9
+ branches: ['main'] # Trigger on pushes to main branch
10
+ workflow_dispatch: # Allow manual triggering from the GitHub UI
11
+
12
+ # Concurrency settings to manage multiple workflow runs
13
+ concurrency:
14
+ group: 'pages' # Only one workflow in the 'pages' group can run at a time
15
+ cancel-in-progress: false # Don't cancel in-progress runs when a new one is triggered
16
+
17
+ # Environment variables used by the workflow
18
+ env:
19
+ UV_SYSTEM_PYTHON: 1 # Use system Python with uv package manager
20
+
21
+ jobs:
22
+ # The build job exports marimo notebooks to static HTML/WebAssembly
23
+ build:
24
+ runs-on: ubuntu-latest # Use the latest Ubuntu runner
25
+ steps:
26
+ # Check out the repository code
27
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
28
+
29
+ # Install uv package manager for faster Python package installation
30
+ - name: 🚀 Install uv
31
+ uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
32
+
33
+ # Run the build script to export notebooks to WebAssembly
34
+ - name: 🛠️ Export notebooks
35
+ run: |
36
+ # todo: Ultimately this function should not be part of this repo
37
+ # It should very much be an action such that other repos
38
+ # can use it without forking or copying it
39
+ # No, it should not be an action. As otherwise can't run before push
40
+ uv run .github/scripts/build.py # This script exports all notebooks to the _site directory
41
+ tree _site # Display the exported files
42
+
43
+ # Upload the generated site as an artifact for the deploy job
44
+ - name: 📤 Upload artifact
45
+ uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4
46
+ with:
47
+ path: _site # Directory containing the built site
48
+
49
+ # The deploy job publishes the built site to GitHub Pages
50
+ deploy:
51
+ needs: build # This job depends on the build job completing successfully
52
+
53
+ # Required permissions for the GitHub Pages deployment
54
+ permissions:
55
+ pages: write # Permission to deploy to Pages
56
+ id-token: write # Permission to verify the deployment
57
+
58
+ # Configure the deployment environment
59
+ environment:
60
+ name: github-pages # Deploy to the github-pages environment
61
+ url: ${{ steps.deployment.outputs.page_url }} # Use the URL from the deployment step
62
+
63
+ runs-on: ubuntu-latest # Use the latest Ubuntu runner
64
+ steps:
65
+ # Deploy the site to GitHub Pages using the official action
66
+ - name: 🚀 Deploy to GitHub Pages
67
+ id: deployment # ID used to reference this step's outputs
68
+ uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4 # GitHub's official Pages deployment action
.gitignore ADDED
@@ -0,0 +1,183 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ _site/
2
+ __marimo__
3
+ test_output
4
+
5
+ # Byte-compiled / optimized / DLL files
6
+ __pycache__/
7
+ *.py[cod]
8
+ *$py.class
9
+
10
+ # C extensions
11
+ *.so
12
+
13
+ # Distribution / packaging
14
+ .Python
15
+ build/
16
+ develop-eggs/
17
+ dist/
18
+ downloads/
19
+ eggs/
20
+ .eggs/
21
+ lib/
22
+ lib64/
23
+ parts/
24
+ sdist/
25
+ var/
26
+ wheels/
27
+ share/python-wheels/
28
+ *.egg-info/
29
+ .installed.cfg
30
+ *.egg
31
+ MANIFEST
32
+
33
+ # PyInstaller
34
+ # Usually these files are written by a python script from a template
35
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
36
+ *.manifest
37
+ *.spec
38
+
39
+ # Installer logs
40
+ pip-log.txt
41
+ pip-delete-this-directory.txt
42
+
43
+ # Unit test / coverage reports
44
+ htmlcov/
45
+ .tox/
46
+ .nox/
47
+ .coverage
48
+ .coverage.*
49
+ .cache
50
+ nosetests.xml
51
+ coverage.xml
52
+ *.cover
53
+ *.py,cover
54
+ .hypothesis/
55
+ .pytest_cache/
56
+ cover/
57
+
58
+ # Translations
59
+ *.mo
60
+ *.pot
61
+
62
+ # Django stuff:
63
+ *.log
64
+ local_settings.py
65
+ db.sqlite3
66
+ db.sqlite3-journal
67
+
68
+ # Flask stuff:
69
+ instance/
70
+ .webassets-cache
71
+
72
+ # Scrapy stuff:
73
+ .scrapy
74
+
75
+ # Sphinx documentation
76
+ docs/_build/
77
+
78
+ # PyBuilder
79
+ .pybuilder/
80
+ target/
81
+
82
+ # Jupyter Notebook
83
+ .ipynb_checkpoints
84
+
85
+ # IPython
86
+ profile_default/
87
+ ipython_config.py
88
+
89
+ # pyenv
90
+ # For a library or package, you might want to ignore these files since the code is
91
+ # intended to run in multiple environments; otherwise, check them in:
92
+ # .python-version
93
+
94
+ # pipenv
95
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
96
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
97
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
98
+ # install all needed dependencies.
99
+ #Pipfile.lock
100
+
101
+ # UV
102
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
103
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
104
+ # commonly ignored for libraries.
105
+ #uv.lock
106
+
107
+ # poetry
108
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
109
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
110
+ # commonly ignored for libraries.
111
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
112
+ #poetry.lock
113
+
114
+ # pdm
115
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
116
+ #pdm.lock
117
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
118
+ # in version control.
119
+ # https://pdm.fming.dev/latest/usage/project/#working-with-version-control
120
+ .pdm.toml
121
+ .pdm-python
122
+ .pdm-build/
123
+
124
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
125
+ __pypackages__/
126
+
127
+ # Celery stuff
128
+ celerybeat-schedule
129
+ celerybeat.pid
130
+
131
+ # SageMath parsed files
132
+ *.sage.py
133
+
134
+ # Environments
135
+ .env
136
+ .venv
137
+ env/
138
+ venv/
139
+ ENV/
140
+ env.bak/
141
+ venv.bak/
142
+
143
+ # Spyder project settings
144
+ .spyderproject
145
+ .spyproject
146
+
147
+ # Rope project settings
148
+ .ropeproject
149
+
150
+ # mkdocs documentation
151
+ /site
152
+
153
+ # mypy
154
+ .mypy_cache/
155
+ .dmypy.json
156
+ dmypy.json
157
+
158
+ # Pyre type checker
159
+ .pyre/
160
+
161
+ # pytype static type analyzer
162
+ .pytype/
163
+
164
+ # Cython debug symbols
165
+ cython_debug/
166
+
167
+ # PyCharm
168
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
169
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
170
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
171
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
172
+ .idea/
173
+
174
+ # PyPI configuration file
175
+ .pypirc
176
+
177
+ .DS_Store
178
+ .marimo
179
+ test/
180
+
181
+ .devbox
182
+ # enforcing strict reproducibility not suitable for template
183
+ devbox.lock
LICENSE ADDED
@@ -0,0 +1,201 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
README.md ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # marimo WebAssembly + GitHub Pages Template
2
+
3
+ This template repository demonstrates how to export [marimo](https://marimo.io) notebooks to WebAssembly and deploy them to GitHub Pages.
4
+
5
+ ## 📚 Included Examples
6
+
7
+ - `apps/charts.py`: Interactive data visualization with Altair
8
+ - `notebooks/fibonacci.py`: Interactive Fibonacci sequence calculator
9
+ - `notebooks/penguins.py`: Interactive data analysis with Polars and marimo
10
+
11
+ ## 🚀 Usage
12
+
13
+ 1. Fork this repository
14
+ 2. Add your marimo files to the `notebooks/` or `apps/` directory
15
+ 1. `notebooks/` notebooks are exported with `--mode edit`
16
+ 2. `apps/` notebooks are exported with `--mode run`
17
+ 3. Push to main branch
18
+ 4. Go to repository **Settings > Pages** and change the "Source" dropdown to "GitHub Actions"
19
+ 5. GitHub Actions will automatically build and deploy to Pages
20
+
21
+ ## Including data or assets
22
+
23
+ To include data or assets in your notebooks, add them to the `public/` directory.
24
+
25
+ For example, the `apps/charts.py` notebook loads an image asset from the `public/` directory.
26
+
27
+ ```markdown
28
+ <img src="public/logo.png" width="200" />
29
+ ```
30
+
31
+ And the `notebooks/penguins.py` notebook loads a CSV dataset from the `public/` directory.
32
+
33
+ ```python
34
+ import polars as pl
35
+ df = pl.read_csv(mo.notebook_location() / "public" / "penguins.csv")
36
+ ```
37
+
38
+ ## 🎨 Templates
39
+
40
+ This repository includes several templates for the generated site:
41
+
42
+ 1. `index.html.j2` (default): A template with styling and a footer
43
+ 2. `bare.html.j2`: A minimal template with basic styling
44
+ 3. `tailwind.html.j2`: A minimal and lean template using Tailwind CSS
45
+
46
+ To use a specific template, pass the `--template` parameter to the build script:
47
+
48
+ ```bash
49
+ uv run .github/scripts/build.py --template templates/tailwind.html.j2
50
+ ```
51
+
52
+ You can also create your own custom templates. See the [templates/README.md](templates/README.md) for more information.
53
+
54
+ ## 🧪 Testing
55
+
56
+ To test the export process, run `.github/scripts/build.py` from the root directory.
57
+
58
+ ```bash
59
+ uv run .github/scripts/build.py
60
+ ```
61
+
62
+ This will export all notebooks in a folder called `_site/` in the root directory. Then to serve the site, run:
63
+
64
+ ```bash
65
+ python -m http.server -d _site
66
+ ```
67
+
68
+ This will serve the site at `http://localhost:8000`.
apps/charts.py ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # /// script
2
+ # requires-python = ">=3.12"
3
+ # dependencies = [
4
+ # "marimo==0.13.15",
5
+ # "altair==4.2.0",
6
+ # "pandas==2.3.0",
7
+ # "numpy==2.3.0"
8
+ # ]
9
+ # ///
10
+ import marimo
11
+
12
+ __generated_with = "0.10.9"
13
+ app = marimo.App(width="medium")
14
+
15
+ with app.setup:
16
+ import numpy as np
17
+ import altair as alt
18
+ import pandas as pd
19
+ import marimo as mo
20
+
21
+
22
+ @app.cell
23
+ def _():
24
+ mo.md(
25
+ """
26
+ # Interactive Data Visualization
27
+
28
+ <img src="public/logo.png" width="200" />
29
+
30
+ This notebook demonstrates a simple interactive visualization using Altair.
31
+ Try selecting the points!
32
+ """
33
+ )
34
+ return
35
+
36
+
37
+ @app.cell
38
+ def _():
39
+ # Create sample data
40
+ data = pd.DataFrame({"x": np.arange(100), "y": np.random.normal(0, 1, 100)})
41
+
42
+ # Create interactive chart
43
+ chart = mo.ui.altair_chart(
44
+ (
45
+ alt.Chart(data)
46
+ .mark_circle()
47
+ .encode(x="x", y="y", size=alt.value(100), color=alt.value("steelblue"))
48
+ .properties(height=400, title="Interactive Scatter Plot")
49
+ )
50
+ )
51
+ chart
52
+ return chart
53
+
54
+
55
+ @app.cell
56
+ def _(chart):
57
+ chart.value
58
+ return
59
+
60
+
61
+ if __name__ == "__main__":
62
+ app.run()
apps/public/logo.png ADDED
apps/reactive_plots.py ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # /// script
2
+ # requires-python = ">=3.9"
3
+ # dependencies = [
4
+ # "altair==5.4.1",
5
+ # "marimo",
6
+ # "vega-datasets==0.9.0",
7
+ # ]
8
+ # ///
9
+
10
+ import marimo
11
+
12
+ __generated_with = "0.8.19"
13
+ app = marimo.App(width="full")
14
+
15
+
16
+ @app.cell(hide_code=True)
17
+ def __(mo):
18
+ mo.md("""# Welcome to marimo!""")
19
+ return
20
+
21
+
22
+ @app.cell
23
+ def __(bars, mo, scatter):
24
+ chart = mo.ui.altair_chart(scatter & bars)
25
+ chart
26
+ return (chart,)
27
+
28
+
29
+ @app.cell
30
+ def __(chart, mo):
31
+ (filtered_data := mo.ui.table(chart.value))
32
+ return (filtered_data,)
33
+
34
+
35
+ @app.cell
36
+ def __(alt, filtered_data, mo):
37
+ mo.stop(not len(filtered_data.value))
38
+ mpg_hist = mo.ui.altair_chart(
39
+ alt.Chart(filtered_data.value)
40
+ .mark_bar()
41
+ .encode(alt.X("Miles_per_Gallon:Q", bin=True), y="count()")
42
+ )
43
+ horsepower_hist = mo.ui.altair_chart(
44
+ alt.Chart(filtered_data.value)
45
+ .mark_bar()
46
+ .encode(alt.X("Horsepower:Q", bin=True), y="count()")
47
+ )
48
+ mo.hstack([mpg_hist, horsepower_hist], justify="space-around", widths="equal")
49
+ return horsepower_hist, mpg_hist
50
+
51
+
52
+ @app.cell
53
+ def __(alt, data):
54
+ cars = data.cars()
55
+ brush = alt.selection_interval()
56
+ scatter = (
57
+ alt.Chart(cars)
58
+ .mark_point()
59
+ .encode(
60
+ x="Horsepower",
61
+ y="Miles_per_Gallon",
62
+ color="Origin",
63
+ )
64
+ .add_params(brush)
65
+ )
66
+ bars = (
67
+ alt.Chart(cars)
68
+ .mark_bar()
69
+ .encode(y="Origin:N", color="Origin:N", x="count(Origin):Q")
70
+ .transform_filter(brush)
71
+ )
72
+ return bars, brush, cars, scatter
73
+
74
+
75
+ @app.cell
76
+ def __():
77
+ import altair as alt
78
+ from vega_datasets import data
79
+ return alt, data
80
+
81
+
82
+ @app.cell
83
+ def __():
84
+ import marimo as mo
85
+ return (mo,)
86
+
87
+
88
+ if __name__ == "__main__":
89
+ app.run()
build.py ADDED
@@ -0,0 +1 @@
 
 
1
+ .github/scripts/build.py
demo.sh ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ #
3
+ # Demo script for marimo WebAssembly + GitHub Pages Template
4
+ # This script demonstrates how to build the site locally for testing purposes.
5
+ # It installs the necessary tools and runs the build script with appropriate parameters.
6
+
7
+ # Install uv/uvx - a fast, user-friendly Python package installer and resolver
8
+ # uv is similar to pip but with improved performance and dependency resolution
9
+ # The -LsSf flags for curl mean:
10
+ # -L: Follow redirects
11
+ # -s: Silent mode
12
+ # -S: Show error if fails
13
+ # -f: Fail silently on server errors
14
+ curl -LsSf https://astral.sh/uv/install.sh | sh
15
+
16
+ # Run the build.py script using uv
17
+ # This is interesting as it works without explicitly installing
18
+ # the dependencies before running this script - uv handles this automatically
19
+ #
20
+ # Parameters:
21
+ # --output_dir '_site': Specifies where to output the generated site files
22
+ # '_site' is a common convention for static site generators
23
+ #
24
+ # --template 'templates/tailwind.html.j2': Specifies which template to use
25
+ # This uses the Tailwind CSS template
26
+ # for a clean, responsive design
27
+ uv run build.py \
28
+ --output_dir '_site' \
29
+ --template 'templates/tailwind.html.j2'
devbox.json ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.16.0/.schema/devbox.schema.json",
3
+ "packages": ["uv@latest", "python@latest"],
4
+ "shell": {
5
+ "init_hook": [". $VENV_DIR/bin/activate"],
6
+ "scripts": {
7
+ "build": [
8
+ "uv run build.py --output_dir '_site' --template 'templates/tailwind.html.j2'"
9
+ ],
10
+ "serve": ["python -m http.server -d _site"]
11
+ }
12
+ }
13
+ }
notebooks/fibonacci.py ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # /// script
2
+ # requires-python = ">=3.12"
3
+ # dependencies = [
4
+ # "marimo==0.13.15",
5
+ # ]
6
+ # ///
7
+ import marimo
8
+
9
+ __generated_with = "0.10.6"
10
+ app = marimo.App()
11
+
12
+ with app.setup:
13
+ import marimo as mo
14
+
15
+ @app.cell
16
+ def _():
17
+ mo.md(
18
+ r"""
19
+ # Fibonacci Calculator
20
+
21
+ Use the slider above to calculate the first {n.value} numbers in the Fibonacci sequence.
22
+ """
23
+ )
24
+ return
25
+
26
+
27
+ @app.cell
28
+ def _():
29
+ # Create an interactive slider
30
+ n = mo.ui.slider(1, 100, value=50, label="Number of Fibonacci numbers")
31
+ n
32
+ return n
33
+
34
+
35
+ @app.cell
36
+ def _(n):
37
+ fib = fibonacci(n.value)
38
+ mo.md(", ".join([str(f) for f in fib]))
39
+
40
+ @app.function
41
+ def fibonacci(n):
42
+ sequence = [0, 1]
43
+ for i in range(2, n):
44
+ sequence.append(sequence[i - 1] + sequence[i - 2])
45
+ return sequence
46
+
47
+
48
+ if __name__ == "__main__":
49
+ app.run()
notebooks/penguins.py ADDED
@@ -0,0 +1,112 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # /// script
2
+ # requires-python = ">=3.12"
3
+ # dependencies = [
4
+ # "marimo==0.13.15",
5
+ # "polars==1.30.0",
6
+ # "altair==4.2.0",
7
+ # "pandas==2.3.0",
8
+ # ]
9
+ # ///
10
+ import marimo
11
+
12
+ __generated_with = "0.13.5"
13
+ app = marimo.App(width="medium")
14
+
15
+ with app.setup:
16
+ import marimo as mo
17
+ import polars as pl
18
+ import altair as alt
19
+ import pandas as pd
20
+
21
+ file = mo.notebook_location() / "public" / "penguins.csv"
22
+
23
+ @app.cell(hide_code=True)
24
+ def _():
25
+ mo.md(
26
+ """
27
+ # Palmer Penguins Analysis
28
+
29
+ Analyzing the Palmer Penguins dataset using Polars and marimo.
30
+ """
31
+ )
32
+ return
33
+
34
+
35
+ @app.cell
36
+ def _():
37
+ # Read the penguins dataset
38
+ df = pl.read_csv(str(file))
39
+ df.head()
40
+ return (df,)
41
+
42
+ @app.cell
43
+ def _():
44
+ # Try to avoid reading the file with pandas
45
+ _df = pd.read_csv(str(file))
46
+ return
47
+
48
+ @app.cell
49
+ def _(df):
50
+ # Basic statistics
51
+ mo.md(f"""
52
+ ### Dataset Overview
53
+
54
+ - Total records: {df.height}
55
+ - Columns: {', '.join(df.columns)}
56
+
57
+ ### Summary Statistics
58
+
59
+ {mo.as_html(df.describe())}
60
+ """)
61
+ return
62
+
63
+
64
+ @app.cell(hide_code=True)
65
+ def _():
66
+ mo.md(r"""### Species Distribution""")
67
+ return
68
+
69
+
70
+ @app.cell
71
+ def _(df):
72
+ # Create species distribution chart
73
+ species_chart = mo.ui.altair_chart(
74
+ alt.Chart(df)
75
+ .mark_bar()
76
+ .encode(x="species", y="count()", color="species")
77
+ .properties(title="Distribution of Penguin Species"),
78
+ chart_selection=None,
79
+ )
80
+
81
+ species_chart
82
+ return (species_chart,)
83
+
84
+
85
+ @app.cell(hide_code=True)
86
+ def _():
87
+ mo.md(r"""### Bill Dimensions Analysis""")
88
+ return
89
+
90
+
91
+ @app.cell
92
+ def _(df):
93
+ # Scatter plot of bill dimensions
94
+ scatter = mo.ui.altair_chart(
95
+ alt.Chart(df)
96
+ .mark_point()
97
+ .encode(
98
+ x="bill_length_mm",
99
+ y="bill_depth_mm",
100
+ color="species",
101
+ tooltip=["species", "bill_length_mm", "bill_depth_mm"],
102
+ )
103
+ .properties(title="Bill Length vs Depth by Species"),
104
+ chart_selection=None,
105
+ )
106
+
107
+ scatter
108
+ return (scatter,)
109
+
110
+
111
+ if __name__ == "__main__":
112
+ app.run()
notebooks/public/penguins.csv ADDED
@@ -0,0 +1,345 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ species,island,bill_length_mm,bill_depth_mm,flipper_length_mm,body_mass_g,sex
2
+ Adelie,Torgersen,39.1,18.7,181,3750,MALE
3
+ Adelie,Torgersen,39.5,17.4,186,3800,FEMALE
4
+ Adelie,Torgersen,40.3,18,195,3250,FEMALE
5
+ Adelie,Torgersen,,,,,
6
+ Adelie,Torgersen,36.7,19.3,193,3450,FEMALE
7
+ Adelie,Torgersen,39.3,20.6,190,3650,MALE
8
+ Adelie,Torgersen,38.9,17.8,181,3625,FEMALE
9
+ Adelie,Torgersen,39.2,19.6,195,4675,MALE
10
+ Adelie,Torgersen,34.1,18.1,193,3475,
11
+ Adelie,Torgersen,42,20.2,190,4250,
12
+ Adelie,Torgersen,37.8,17.1,186,3300,
13
+ Adelie,Torgersen,37.8,17.3,180,3700,
14
+ Adelie,Torgersen,41.1,17.6,182,3200,FEMALE
15
+ Adelie,Torgersen,38.6,21.2,191,3800,MALE
16
+ Adelie,Torgersen,34.6,21.1,198,4400,MALE
17
+ Adelie,Torgersen,36.6,17.8,185,3700,FEMALE
18
+ Adelie,Torgersen,38.7,19,195,3450,FEMALE
19
+ Adelie,Torgersen,42.5,20.7,197,4500,MALE
20
+ Adelie,Torgersen,34.4,18.4,184,3325,FEMALE
21
+ Adelie,Torgersen,46,21.5,194,4200,MALE
22
+ Adelie,Biscoe,37.8,18.3,174,3400,FEMALE
23
+ Adelie,Biscoe,37.7,18.7,180,3600,MALE
24
+ Adelie,Biscoe,35.9,19.2,189,3800,FEMALE
25
+ Adelie,Biscoe,38.2,18.1,185,3950,MALE
26
+ Adelie,Biscoe,38.8,17.2,180,3800,MALE
27
+ Adelie,Biscoe,35.3,18.9,187,3800,FEMALE
28
+ Adelie,Biscoe,40.6,18.6,183,3550,MALE
29
+ Adelie,Biscoe,40.5,17.9,187,3200,FEMALE
30
+ Adelie,Biscoe,37.9,18.6,172,3150,FEMALE
31
+ Adelie,Biscoe,40.5,18.9,180,3950,MALE
32
+ Adelie,Dream,39.5,16.7,178,3250,FEMALE
33
+ Adelie,Dream,37.2,18.1,178,3900,MALE
34
+ Adelie,Dream,39.5,17.8,188,3300,FEMALE
35
+ Adelie,Dream,40.9,18.9,184,3900,MALE
36
+ Adelie,Dream,36.4,17,195,3325,FEMALE
37
+ Adelie,Dream,39.2,21.1,196,4150,MALE
38
+ Adelie,Dream,38.8,20,190,3950,MALE
39
+ Adelie,Dream,42.2,18.5,180,3550,FEMALE
40
+ Adelie,Dream,37.6,19.3,181,3300,FEMALE
41
+ Adelie,Dream,39.8,19.1,184,4650,MALE
42
+ Adelie,Dream,36.5,18,182,3150,FEMALE
43
+ Adelie,Dream,40.8,18.4,195,3900,MALE
44
+ Adelie,Dream,36,18.5,186,3100,FEMALE
45
+ Adelie,Dream,44.1,19.7,196,4400,MALE
46
+ Adelie,Dream,37,16.9,185,3000,FEMALE
47
+ Adelie,Dream,39.6,18.8,190,4600,MALE
48
+ Adelie,Dream,41.1,19,182,3425,MALE
49
+ Adelie,Dream,37.5,18.9,179,2975,
50
+ Adelie,Dream,36,17.9,190,3450,FEMALE
51
+ Adelie,Dream,42.3,21.2,191,4150,MALE
52
+ Adelie,Biscoe,39.6,17.7,186,3500,FEMALE
53
+ Adelie,Biscoe,40.1,18.9,188,4300,MALE
54
+ Adelie,Biscoe,35,17.9,190,3450,FEMALE
55
+ Adelie,Biscoe,42,19.5,200,4050,MALE
56
+ Adelie,Biscoe,34.5,18.1,187,2900,FEMALE
57
+ Adelie,Biscoe,41.4,18.6,191,3700,MALE
58
+ Adelie,Biscoe,39,17.5,186,3550,FEMALE
59
+ Adelie,Biscoe,40.6,18.8,193,3800,MALE
60
+ Adelie,Biscoe,36.5,16.6,181,2850,FEMALE
61
+ Adelie,Biscoe,37.6,19.1,194,3750,MALE
62
+ Adelie,Biscoe,35.7,16.9,185,3150,FEMALE
63
+ Adelie,Biscoe,41.3,21.1,195,4400,MALE
64
+ Adelie,Biscoe,37.6,17,185,3600,FEMALE
65
+ Adelie,Biscoe,41.1,18.2,192,4050,MALE
66
+ Adelie,Biscoe,36.4,17.1,184,2850,FEMALE
67
+ Adelie,Biscoe,41.6,18,192,3950,MALE
68
+ Adelie,Biscoe,35.5,16.2,195,3350,FEMALE
69
+ Adelie,Biscoe,41.1,19.1,188,4100,MALE
70
+ Adelie,Torgersen,35.9,16.6,190,3050,FEMALE
71
+ Adelie,Torgersen,41.8,19.4,198,4450,MALE
72
+ Adelie,Torgersen,33.5,19,190,3600,FEMALE
73
+ Adelie,Torgersen,39.7,18.4,190,3900,MALE
74
+ Adelie,Torgersen,39.6,17.2,196,3550,FEMALE
75
+ Adelie,Torgersen,45.8,18.9,197,4150,MALE
76
+ Adelie,Torgersen,35.5,17.5,190,3700,FEMALE
77
+ Adelie,Torgersen,42.8,18.5,195,4250,MALE
78
+ Adelie,Torgersen,40.9,16.8,191,3700,FEMALE
79
+ Adelie,Torgersen,37.2,19.4,184,3900,MALE
80
+ Adelie,Torgersen,36.2,16.1,187,3550,FEMALE
81
+ Adelie,Torgersen,42.1,19.1,195,4000,MALE
82
+ Adelie,Torgersen,34.6,17.2,189,3200,FEMALE
83
+ Adelie,Torgersen,42.9,17.6,196,4700,MALE
84
+ Adelie,Torgersen,36.7,18.8,187,3800,FEMALE
85
+ Adelie,Torgersen,35.1,19.4,193,4200,MALE
86
+ Adelie,Dream,37.3,17.8,191,3350,FEMALE
87
+ Adelie,Dream,41.3,20.3,194,3550,MALE
88
+ Adelie,Dream,36.3,19.5,190,3800,MALE
89
+ Adelie,Dream,36.9,18.6,189,3500,FEMALE
90
+ Adelie,Dream,38.3,19.2,189,3950,MALE
91
+ Adelie,Dream,38.9,18.8,190,3600,FEMALE
92
+ Adelie,Dream,35.7,18,202,3550,FEMALE
93
+ Adelie,Dream,41.1,18.1,205,4300,MALE
94
+ Adelie,Dream,34,17.1,185,3400,FEMALE
95
+ Adelie,Dream,39.6,18.1,186,4450,MALE
96
+ Adelie,Dream,36.2,17.3,187,3300,FEMALE
97
+ Adelie,Dream,40.8,18.9,208,4300,MALE
98
+ Adelie,Dream,38.1,18.6,190,3700,FEMALE
99
+ Adelie,Dream,40.3,18.5,196,4350,MALE
100
+ Adelie,Dream,33.1,16.1,178,2900,FEMALE
101
+ Adelie,Dream,43.2,18.5,192,4100,MALE
102
+ Adelie,Biscoe,35,17.9,192,3725,FEMALE
103
+ Adelie,Biscoe,41,20,203,4725,MALE
104
+ Adelie,Biscoe,37.7,16,183,3075,FEMALE
105
+ Adelie,Biscoe,37.8,20,190,4250,MALE
106
+ Adelie,Biscoe,37.9,18.6,193,2925,FEMALE
107
+ Adelie,Biscoe,39.7,18.9,184,3550,MALE
108
+ Adelie,Biscoe,38.6,17.2,199,3750,FEMALE
109
+ Adelie,Biscoe,38.2,20,190,3900,MALE
110
+ Adelie,Biscoe,38.1,17,181,3175,FEMALE
111
+ Adelie,Biscoe,43.2,19,197,4775,MALE
112
+ Adelie,Biscoe,38.1,16.5,198,3825,FEMALE
113
+ Adelie,Biscoe,45.6,20.3,191,4600,MALE
114
+ Adelie,Biscoe,39.7,17.7,193,3200,FEMALE
115
+ Adelie,Biscoe,42.2,19.5,197,4275,MALE
116
+ Adelie,Biscoe,39.6,20.7,191,3900,FEMALE
117
+ Adelie,Biscoe,42.7,18.3,196,4075,MALE
118
+ Adelie,Torgersen,38.6,17,188,2900,FEMALE
119
+ Adelie,Torgersen,37.3,20.5,199,3775,MALE
120
+ Adelie,Torgersen,35.7,17,189,3350,FEMALE
121
+ Adelie,Torgersen,41.1,18.6,189,3325,MALE
122
+ Adelie,Torgersen,36.2,17.2,187,3150,FEMALE
123
+ Adelie,Torgersen,37.7,19.8,198,3500,MALE
124
+ Adelie,Torgersen,40.2,17,176,3450,FEMALE
125
+ Adelie,Torgersen,41.4,18.5,202,3875,MALE
126
+ Adelie,Torgersen,35.2,15.9,186,3050,FEMALE
127
+ Adelie,Torgersen,40.6,19,199,4000,MALE
128
+ Adelie,Torgersen,38.8,17.6,191,3275,FEMALE
129
+ Adelie,Torgersen,41.5,18.3,195,4300,MALE
130
+ Adelie,Torgersen,39,17.1,191,3050,FEMALE
131
+ Adelie,Torgersen,44.1,18,210,4000,MALE
132
+ Adelie,Torgersen,38.5,17.9,190,3325,FEMALE
133
+ Adelie,Torgersen,43.1,19.2,197,3500,MALE
134
+ Adelie,Dream,36.8,18.5,193,3500,FEMALE
135
+ Adelie,Dream,37.5,18.5,199,4475,MALE
136
+ Adelie,Dream,38.1,17.6,187,3425,FEMALE
137
+ Adelie,Dream,41.1,17.5,190,3900,MALE
138
+ Adelie,Dream,35.6,17.5,191,3175,FEMALE
139
+ Adelie,Dream,40.2,20.1,200,3975,MALE
140
+ Adelie,Dream,37,16.5,185,3400,FEMALE
141
+ Adelie,Dream,39.7,17.9,193,4250,MALE
142
+ Adelie,Dream,40.2,17.1,193,3400,FEMALE
143
+ Adelie,Dream,40.6,17.2,187,3475,MALE
144
+ Adelie,Dream,32.1,15.5,188,3050,FEMALE
145
+ Adelie,Dream,40.7,17,190,3725,MALE
146
+ Adelie,Dream,37.3,16.8,192,3000,FEMALE
147
+ Adelie,Dream,39,18.7,185,3650,MALE
148
+ Adelie,Dream,39.2,18.6,190,4250,MALE
149
+ Adelie,Dream,36.6,18.4,184,3475,FEMALE
150
+ Adelie,Dream,36,17.8,195,3450,FEMALE
151
+ Adelie,Dream,37.8,18.1,193,3750,MALE
152
+ Adelie,Dream,36,17.1,187,3700,FEMALE
153
+ Adelie,Dream,41.5,18.5,201,4000,MALE
154
+ Chinstrap,Dream,46.5,17.9,192,3500,FEMALE
155
+ Chinstrap,Dream,50,19.5,196,3900,MALE
156
+ Chinstrap,Dream,51.3,19.2,193,3650,MALE
157
+ Chinstrap,Dream,45.4,18.7,188,3525,FEMALE
158
+ Chinstrap,Dream,52.7,19.8,197,3725,MALE
159
+ Chinstrap,Dream,45.2,17.8,198,3950,FEMALE
160
+ Chinstrap,Dream,46.1,18.2,178,3250,FEMALE
161
+ Chinstrap,Dream,51.3,18.2,197,3750,MALE
162
+ Chinstrap,Dream,46,18.9,195,4150,FEMALE
163
+ Chinstrap,Dream,51.3,19.9,198,3700,MALE
164
+ Chinstrap,Dream,46.6,17.8,193,3800,FEMALE
165
+ Chinstrap,Dream,51.7,20.3,194,3775,MALE
166
+ Chinstrap,Dream,47,17.3,185,3700,FEMALE
167
+ Chinstrap,Dream,52,18.1,201,4050,MALE
168
+ Chinstrap,Dream,45.9,17.1,190,3575,FEMALE
169
+ Chinstrap,Dream,50.5,19.6,201,4050,MALE
170
+ Chinstrap,Dream,50.3,20,197,3300,MALE
171
+ Chinstrap,Dream,58,17.8,181,3700,FEMALE
172
+ Chinstrap,Dream,46.4,18.6,190,3450,FEMALE
173
+ Chinstrap,Dream,49.2,18.2,195,4400,MALE
174
+ Chinstrap,Dream,42.4,17.3,181,3600,FEMALE
175
+ Chinstrap,Dream,48.5,17.5,191,3400,MALE
176
+ Chinstrap,Dream,43.2,16.6,187,2900,FEMALE
177
+ Chinstrap,Dream,50.6,19.4,193,3800,MALE
178
+ Chinstrap,Dream,46.7,17.9,195,3300,FEMALE
179
+ Chinstrap,Dream,52,19,197,4150,MALE
180
+ Chinstrap,Dream,50.5,18.4,200,3400,FEMALE
181
+ Chinstrap,Dream,49.5,19,200,3800,MALE
182
+ Chinstrap,Dream,46.4,17.8,191,3700,FEMALE
183
+ Chinstrap,Dream,52.8,20,205,4550,MALE
184
+ Chinstrap,Dream,40.9,16.6,187,3200,FEMALE
185
+ Chinstrap,Dream,54.2,20.8,201,4300,MALE
186
+ Chinstrap,Dream,42.5,16.7,187,3350,FEMALE
187
+ Chinstrap,Dream,51,18.8,203,4100,MALE
188
+ Chinstrap,Dream,49.7,18.6,195,3600,MALE
189
+ Chinstrap,Dream,47.5,16.8,199,3900,FEMALE
190
+ Chinstrap,Dream,47.6,18.3,195,3850,FEMALE
191
+ Chinstrap,Dream,52,20.7,210,4800,MALE
192
+ Chinstrap,Dream,46.9,16.6,192,2700,FEMALE
193
+ Chinstrap,Dream,53.5,19.9,205,4500,MALE
194
+ Chinstrap,Dream,49,19.5,210,3950,MALE
195
+ Chinstrap,Dream,46.2,17.5,187,3650,FEMALE
196
+ Chinstrap,Dream,50.9,19.1,196,3550,MALE
197
+ Chinstrap,Dream,45.5,17,196,3500,FEMALE
198
+ Chinstrap,Dream,50.9,17.9,196,3675,FEMALE
199
+ Chinstrap,Dream,50.8,18.5,201,4450,MALE
200
+ Chinstrap,Dream,50.1,17.9,190,3400,FEMALE
201
+ Chinstrap,Dream,49,19.6,212,4300,MALE
202
+ Chinstrap,Dream,51.5,18.7,187,3250,MALE
203
+ Chinstrap,Dream,49.8,17.3,198,3675,FEMALE
204
+ Chinstrap,Dream,48.1,16.4,199,3325,FEMALE
205
+ Chinstrap,Dream,51.4,19,201,3950,MALE
206
+ Chinstrap,Dream,45.7,17.3,193,3600,FEMALE
207
+ Chinstrap,Dream,50.7,19.7,203,4050,MALE
208
+ Chinstrap,Dream,42.5,17.3,187,3350,FEMALE
209
+ Chinstrap,Dream,52.2,18.8,197,3450,MALE
210
+ Chinstrap,Dream,45.2,16.6,191,3250,FEMALE
211
+ Chinstrap,Dream,49.3,19.9,203,4050,MALE
212
+ Chinstrap,Dream,50.2,18.8,202,3800,MALE
213
+ Chinstrap,Dream,45.6,19.4,194,3525,FEMALE
214
+ Chinstrap,Dream,51.9,19.5,206,3950,MALE
215
+ Chinstrap,Dream,46.8,16.5,189,3650,FEMALE
216
+ Chinstrap,Dream,45.7,17,195,3650,FEMALE
217
+ Chinstrap,Dream,55.8,19.8,207,4000,MALE
218
+ Chinstrap,Dream,43.5,18.1,202,3400,FEMALE
219
+ Chinstrap,Dream,49.6,18.2,193,3775,MALE
220
+ Chinstrap,Dream,50.8,19,210,4100,MALE
221
+ Chinstrap,Dream,50.2,18.7,198,3775,FEMALE
222
+ Gentoo,Biscoe,46.1,13.2,211,4500,FEMALE
223
+ Gentoo,Biscoe,50,16.3,230,5700,MALE
224
+ Gentoo,Biscoe,48.7,14.1,210,4450,FEMALE
225
+ Gentoo,Biscoe,50,15.2,218,5700,MALE
226
+ Gentoo,Biscoe,47.6,14.5,215,5400,MALE
227
+ Gentoo,Biscoe,46.5,13.5,210,4550,FEMALE
228
+ Gentoo,Biscoe,45.4,14.6,211,4800,FEMALE
229
+ Gentoo,Biscoe,46.7,15.3,219,5200,MALE
230
+ Gentoo,Biscoe,43.3,13.4,209,4400,FEMALE
231
+ Gentoo,Biscoe,46.8,15.4,215,5150,MALE
232
+ Gentoo,Biscoe,40.9,13.7,214,4650,FEMALE
233
+ Gentoo,Biscoe,49,16.1,216,5550,MALE
234
+ Gentoo,Biscoe,45.5,13.7,214,4650,FEMALE
235
+ Gentoo,Biscoe,48.4,14.6,213,5850,MALE
236
+ Gentoo,Biscoe,45.8,14.6,210,4200,FEMALE
237
+ Gentoo,Biscoe,49.3,15.7,217,5850,MALE
238
+ Gentoo,Biscoe,42,13.5,210,4150,FEMALE
239
+ Gentoo,Biscoe,49.2,15.2,221,6300,MALE
240
+ Gentoo,Biscoe,46.2,14.5,209,4800,FEMALE
241
+ Gentoo,Biscoe,48.7,15.1,222,5350,MALE
242
+ Gentoo,Biscoe,50.2,14.3,218,5700,MALE
243
+ Gentoo,Biscoe,45.1,14.5,215,5000,FEMALE
244
+ Gentoo,Biscoe,46.5,14.5,213,4400,FEMALE
245
+ Gentoo,Biscoe,46.3,15.8,215,5050,MALE
246
+ Gentoo,Biscoe,42.9,13.1,215,5000,FEMALE
247
+ Gentoo,Biscoe,46.1,15.1,215,5100,MALE
248
+ Gentoo,Biscoe,44.5,14.3,216,4100,
249
+ Gentoo,Biscoe,47.8,15,215,5650,MALE
250
+ Gentoo,Biscoe,48.2,14.3,210,4600,FEMALE
251
+ Gentoo,Biscoe,50,15.3,220,5550,MALE
252
+ Gentoo,Biscoe,47.3,15.3,222,5250,MALE
253
+ Gentoo,Biscoe,42.8,14.2,209,4700,FEMALE
254
+ Gentoo,Biscoe,45.1,14.5,207,5050,FEMALE
255
+ Gentoo,Biscoe,59.6,17,230,6050,MALE
256
+ Gentoo,Biscoe,49.1,14.8,220,5150,FEMALE
257
+ Gentoo,Biscoe,48.4,16.3,220,5400,MALE
258
+ Gentoo,Biscoe,42.6,13.7,213,4950,FEMALE
259
+ Gentoo,Biscoe,44.4,17.3,219,5250,MALE
260
+ Gentoo,Biscoe,44,13.6,208,4350,FEMALE
261
+ Gentoo,Biscoe,48.7,15.7,208,5350,MALE
262
+ Gentoo,Biscoe,42.7,13.7,208,3950,FEMALE
263
+ Gentoo,Biscoe,49.6,16,225,5700,MALE
264
+ Gentoo,Biscoe,45.3,13.7,210,4300,FEMALE
265
+ Gentoo,Biscoe,49.6,15,216,4750,MALE
266
+ Gentoo,Biscoe,50.5,15.9,222,5550,MALE
267
+ Gentoo,Biscoe,43.6,13.9,217,4900,FEMALE
268
+ Gentoo,Biscoe,45.5,13.9,210,4200,FEMALE
269
+ Gentoo,Biscoe,50.5,15.9,225,5400,MALE
270
+ Gentoo,Biscoe,44.9,13.3,213,5100,FEMALE
271
+ Gentoo,Biscoe,45.2,15.8,215,5300,MALE
272
+ Gentoo,Biscoe,46.6,14.2,210,4850,FEMALE
273
+ Gentoo,Biscoe,48.5,14.1,220,5300,MALE
274
+ Gentoo,Biscoe,45.1,14.4,210,4400,FEMALE
275
+ Gentoo,Biscoe,50.1,15,225,5000,MALE
276
+ Gentoo,Biscoe,46.5,14.4,217,4900,FEMALE
277
+ Gentoo,Biscoe,45,15.4,220,5050,MALE
278
+ Gentoo,Biscoe,43.8,13.9,208,4300,FEMALE
279
+ Gentoo,Biscoe,45.5,15,220,5000,MALE
280
+ Gentoo,Biscoe,43.2,14.5,208,4450,FEMALE
281
+ Gentoo,Biscoe,50.4,15.3,224,5550,MALE
282
+ Gentoo,Biscoe,45.3,13.8,208,4200,FEMALE
283
+ Gentoo,Biscoe,46.2,14.9,221,5300,MALE
284
+ Gentoo,Biscoe,45.7,13.9,214,4400,FEMALE
285
+ Gentoo,Biscoe,54.3,15.7,231,5650,MALE
286
+ Gentoo,Biscoe,45.8,14.2,219,4700,FEMALE
287
+ Gentoo,Biscoe,49.8,16.8,230,5700,MALE
288
+ Gentoo,Biscoe,46.2,14.4,214,4650,
289
+ Gentoo,Biscoe,49.5,16.2,229,5800,MALE
290
+ Gentoo,Biscoe,43.5,14.2,220,4700,FEMALE
291
+ Gentoo,Biscoe,50.7,15,223,5550,MALE
292
+ Gentoo,Biscoe,47.7,15,216,4750,FEMALE
293
+ Gentoo,Biscoe,46.4,15.6,221,5000,MALE
294
+ Gentoo,Biscoe,48.2,15.6,221,5100,MALE
295
+ Gentoo,Biscoe,46.5,14.8,217,5200,FEMALE
296
+ Gentoo,Biscoe,46.4,15,216,4700,FEMALE
297
+ Gentoo,Biscoe,48.6,16,230,5800,MALE
298
+ Gentoo,Biscoe,47.5,14.2,209,4600,FEMALE
299
+ Gentoo,Biscoe,51.1,16.3,220,6000,MALE
300
+ Gentoo,Biscoe,45.2,13.8,215,4750,FEMALE
301
+ Gentoo,Biscoe,45.2,16.4,223,5950,MALE
302
+ Gentoo,Biscoe,49.1,14.5,212,4625,FEMALE
303
+ Gentoo,Biscoe,52.5,15.6,221,5450,MALE
304
+ Gentoo,Biscoe,47.4,14.6,212,4725,FEMALE
305
+ Gentoo,Biscoe,50,15.9,224,5350,MALE
306
+ Gentoo,Biscoe,44.9,13.8,212,4750,FEMALE
307
+ Gentoo,Biscoe,50.8,17.3,228,5600,MALE
308
+ Gentoo,Biscoe,43.4,14.4,218,4600,FEMALE
309
+ Gentoo,Biscoe,51.3,14.2,218,5300,MALE
310
+ Gentoo,Biscoe,47.5,14,212,4875,FEMALE
311
+ Gentoo,Biscoe,52.1,17,230,5550,MALE
312
+ Gentoo,Biscoe,47.5,15,218,4950,FEMALE
313
+ Gentoo,Biscoe,52.2,17.1,228,5400,MALE
314
+ Gentoo,Biscoe,45.5,14.5,212,4750,FEMALE
315
+ Gentoo,Biscoe,49.5,16.1,224,5650,MALE
316
+ Gentoo,Biscoe,44.5,14.7,214,4850,FEMALE
317
+ Gentoo,Biscoe,50.8,15.7,226,5200,MALE
318
+ Gentoo,Biscoe,49.4,15.8,216,4925,MALE
319
+ Gentoo,Biscoe,46.9,14.6,222,4875,FEMALE
320
+ Gentoo,Biscoe,48.4,14.4,203,4625,FEMALE
321
+ Gentoo,Biscoe,51.1,16.5,225,5250,MALE
322
+ Gentoo,Biscoe,48.5,15,219,4850,FEMALE
323
+ Gentoo,Biscoe,55.9,17,228,5600,MALE
324
+ Gentoo,Biscoe,47.2,15.5,215,4975,FEMALE
325
+ Gentoo,Biscoe,49.1,15,228,5500,MALE
326
+ Gentoo,Biscoe,47.3,13.8,216,4725,
327
+ Gentoo,Biscoe,46.8,16.1,215,5500,MALE
328
+ Gentoo,Biscoe,41.7,14.7,210,4700,FEMALE
329
+ Gentoo,Biscoe,53.4,15.8,219,5500,MALE
330
+ Gentoo,Biscoe,43.3,14,208,4575,FEMALE
331
+ Gentoo,Biscoe,48.1,15.1,209,5500,MALE
332
+ Gentoo,Biscoe,50.5,15.2,216,5000,FEMALE
333
+ Gentoo,Biscoe,49.8,15.9,229,5950,MALE
334
+ Gentoo,Biscoe,43.5,15.2,213,4650,FEMALE
335
+ Gentoo,Biscoe,51.5,16.3,230,5500,MALE
336
+ Gentoo,Biscoe,46.2,14.1,217,4375,FEMALE
337
+ Gentoo,Biscoe,55.1,16,230,5850,MALE
338
+ Gentoo,Biscoe,44.5,15.7,217,4875,
339
+ Gentoo,Biscoe,48.8,16.2,222,6000,MALE
340
+ Gentoo,Biscoe,47.2,13.7,214,4925,FEMALE
341
+ Gentoo,Biscoe,,,,,
342
+ Gentoo,Biscoe,46.8,14.3,215,4850,FEMALE
343
+ Gentoo,Biscoe,50.4,15.7,222,5750,MALE
344
+ Gentoo,Biscoe,45.2,14.8,212,5200,FEMALE
345
+ Gentoo,Biscoe,49.9,16.1,213,5400,MALE
templates/README.md ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Template Documentation
2
+
3
+ ## Overview
4
+
5
+ This directory contains Jinja2 templates used by the build
6
+ script to generate HTML pages for the marimo WebAssembly + GitHub Pages project.
7
+ Templates define the structure and appearance of the generated pages,
8
+ particularly the index page that lists all notebooks and apps.
9
+
10
+ ## Template Requirements
11
+
12
+ ### Basic Structure
13
+
14
+ A template should be a valid HTML file with Jinja2 syntax for dynamic content. The template should:
15
+
16
+ 1. Have a `.html.j2` extension
17
+ 2. Include proper HTML structure (doctype, head, body)
18
+ 3. Use responsive design principles for good display on various devices
19
+
20
+ ### Expected Variables
21
+
22
+ Templates receive the following variables from the build script:
23
+
24
+ - `notebooks`: A list of dictionaries containing information about notebooks
25
+ - Each notebook has:
26
+ - `display_name`: The formatted name of the notebook (e.g., "Penguins" instead of "penguins")
27
+ - `html_path`: The path to the HTML file for the notebook
28
+
29
+ - `apps`: A list of dictionaries containing information about apps
30
+ - Each app has:
31
+ - `display_name`: The formatted name of the app
32
+ - `html_path`: The path to the HTML file for the app
33
+
34
+ ### Required Sections
35
+
36
+ A complete template should include:
37
+
38
+ 1. **Conditional Notebook Section**: Only display if notebooks exist
39
+
40
+ ```jinja
41
+ {% if notebooks %}
42
+ <h2>Notebooks</h2>
43
+ <div class="notebooks-container">
44
+ {% for notebook in notebooks %}
45
+ <div class="notebook-item">
46
+ <h3>{{ notebook.display_name }}</h3>
47
+ <a href="{{ notebook.html_path }}">Open Notebook</a>
48
+ </div>
49
+ {% endfor %}
50
+ </div>
51
+ {% endif %}
52
+ ```
53
+
54
+ 2. **Conditional App Section**: Only display if apps exist
55
+
56
+ ```jinja
57
+ {% if apps %}
58
+ <h2>Apps</h2>
59
+ <div class="apps-container">
60
+ {% for app in apps %}
61
+ <div class="app-item">
62
+ <h3>{{ app.display_name }}</h3>
63
+ <a href="{{ app.html_path }}">Open App</a>
64
+ </div>
65
+ {% endfor %}
66
+ </div>
67
+ {% endif %}
68
+ ```
69
+
70
+ ## Using Custom Templates
71
+
72
+ To use a custom template with the build script, use the `--template` parameter:
73
+
74
+ ```bash
75
+ uv run .github/scripts/build.py --output-dir _site --template templates/your-custom-template.html.j2
76
+ ```
77
+
78
+ ## Example Templates
79
+
80
+ This repository includes three example templates:
81
+
82
+ 1. `index.html.j2`: A less lean template with more styling and a footer
83
+ 2. `tailwind.html.j2`: A minimal and lean template using Tailwind CSS
84
+
85
+ ## Best Practices
86
+
87
+ 1. **Styling**:
88
+ - Include CSS directly in the template using `<style>` tags for simplicity, or
89
+ - Use Tailwind CSS via CDN for a utility-first approach without custom CSS
90
+ 2. **Responsive Design**: Ensure the template works well on different screen sizes
91
+ 3. **Conditional Sections**: Use `{% if %}` blocks to conditionally display sections based on data availability
92
+ 4. **Comments**: Include comments in your template to explain complex sections
93
+ 5. **Accessibility**: Use semantic HTML and proper ARIA attributes for accessibility
templates/index.html.j2 ADDED
@@ -0,0 +1,146 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>marimo WebAssembly + GitHub Pages Template</title>
7
+ <style>
8
+ body {
9
+ font-family: Arial, sans-serif;
10
+ line-height: 1.6;
11
+ color: #333;
12
+ background-color: #fff;
13
+ padding: 20px;
14
+ margin: 0;
15
+ }
16
+ .container {
17
+ max-width: 1000px;
18
+ margin: 0 auto;
19
+ }
20
+ header {
21
+ background-color: #f0f0f0;
22
+ padding: 20px;
23
+ text-align: center;
24
+ margin-bottom: 20px;
25
+ }
26
+ .logo {
27
+ width: 80px;
28
+ height: auto;
29
+ margin-bottom: 10px;
30
+ }
31
+ h1 {
32
+ font-size: 24px;
33
+ margin-bottom: 10px;
34
+ }
35
+ .subtitle {
36
+ font-size: 16px;
37
+ margin: 0 auto;
38
+ }
39
+ .section-title {
40
+ font-size: 20px;
41
+ margin: 20px 0 10px;
42
+ text-align: center;
43
+ }
44
+ .cards {
45
+ display: flex;
46
+ flex-wrap: wrap;
47
+ gap: 20px;
48
+ margin: 20px 0;
49
+ }
50
+ .card {
51
+ background-color: #f9f9f9;
52
+ border: 1px solid #ddd;
53
+ flex: 1 0 200px;
54
+ }
55
+ .card-header {
56
+ background-color: #ddd;
57
+ padding: 10px;
58
+ font-weight: bold;
59
+ }
60
+ .card-header.app {
61
+ background-color: #eee;
62
+ }
63
+ .card-body {
64
+ padding: 15px;
65
+ }
66
+ .card-link {
67
+ display: inline-block;
68
+ background-color: #4a86e8;
69
+ color: white;
70
+ padding: 5px 10px;
71
+ text-decoration: none;
72
+ }
73
+ .card-link.app {
74
+ background-color: #ff9900;
75
+ }
76
+ footer {
77
+ background-color: #f0f0f0;
78
+ text-align: center;
79
+ padding: 20px 0;
80
+ margin-top: 30px;
81
+ }
82
+ .footer-links a {
83
+ color: #4a86e8;
84
+ margin: 0 10px;
85
+ text-decoration: none;
86
+ }
87
+ </style>
88
+ </head>
89
+ <body class="font-sans max-w-2xl mx-auto p-8 leading-relaxed">
90
+ <header>
91
+ <div class="container">
92
+ <img src="https://raw.githubusercontent.com/marimo-team/marimo/main/docs/_static/marimo-logotype-thick.svg" alt="marimo Logo" class="logo">
93
+ <h1>marimo WebAssembly + GitHub Pages Template</h1>
94
+ <p class="subtitle">Interactive Python notebooks exported to WebAssembly and deployed to GitHub Pages</p>
95
+ </div>
96
+ </header>
97
+
98
+ <main class="container">
99
+
100
+ {% if notebooks %}
101
+ <h2 class="section-title">Notebooks</h2>
102
+ <p>Interactive notebooks in edit mode - you can modify and experiment with the code</p>
103
+ <div class="cards">
104
+ {% for notebook in notebooks %}
105
+ <!-- {{ notebook.display_name }} Notebook -->
106
+ <div class="card">
107
+ <div class="card-header">{{ notebook.display_name }}</div>
108
+ <div class="card-body">
109
+ <a href="{{ notebook.html_path }}" class="card-link">Open Notebook</a>
110
+ </div>
111
+ </div>
112
+ {% endfor %}
113
+ </div>
114
+ {% endif %}
115
+
116
+ {% if apps %}
117
+ <h2 class="section-title">Apps</h2>
118
+ <p>Interactive applications in run mode - code is hidden for a clean user interface</p>
119
+ <div class="cards">
120
+ {% for app in apps %}
121
+ <!-- {{ app.display_name }} App -->
122
+ <div class="card">
123
+ <div class="card-header app">{{ app.display_name }}</div>
124
+ <div class="card-body">
125
+ <a href="{{ app.html_path }}" class="card-link app">Open App</a>
126
+ </div>
127
+ </div>
128
+ {% endfor %}
129
+ </div>
130
+ {% endif %}
131
+ </main>
132
+
133
+ <footer>
134
+ <div class="container">
135
+ <p>Built with <a href="https://marimo.io" target="_blank">marimo</a> - Interactive Python notebooks</p>
136
+ <div class="footer-links">
137
+ <a href="https://github.com/marimo-team/marimo" target="_blank">GitHub</a>
138
+ <a href="https://docs.marimo.io" target="_blank">Documentation</a>
139
+ <a href="https://discord.gg/JE7nhX6mD8" target="_blank">Discord</a>
140
+ </div>
141
+ <p>Licensed under <a href="https://github.com/marimo-team/marimo/blob/main/LICENSE" target="_blank">Apache License 2.0</a></p>
142
+ </div>
143
+ </footer>
144
+
145
+ </body>
146
+ </html>
templates/tailwind.html.j2 ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>marimo WebAssembly + GitHub Pages Template</title>
7
+ <!-- Include Tailwind CSS via CDN -->
8
+ <script src="https://cdn.tailwindcss.com"></script>
9
+ </head>
10
+ <body class="font-sans text-gray-800 bg-white p-5">
11
+ <div class="max-w-4xl mx-auto">
12
+ <!-- Header -->
13
+ <header class="bg-gray-100 p-6 text-center rounded-lg mb-6">
14
+ <img src="https://raw.githubusercontent.com/marimo-team/marimo/main/docs/_static/marimo-logotype-thick.svg" alt="marimo Logo" class="w-20 h-auto mx-auto mb-3">
15
+ <h1 class="text-2xl font-bold mb-2">marimo WebAssembly + GitHub Pages Template</h1>
16
+ <p class="text-sm">Interactive Python notebooks exported to WebAssembly and deployed to GitHub Pages</p>
17
+ </header>
18
+
19
+ <main>
20
+ {% if notebooks %}
21
+ <h2 class="text-xl font-bold text-center my-4">Notebooks</h2>
22
+ <p class="text-center mb-4">Interactive notebooks in edit mode - you can modify and experiment with the code</p>
23
+ <div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 mb-8">
24
+ {% for notebook in notebooks %}
25
+ <!-- {{ notebook.display_name }} Notebook -->
26
+ <div class="bg-gray-50 border border-gray-200 rounded-lg overflow-hidden">
27
+ <div class="bg-gray-200 p-3 font-semibold">{{ notebook.display_name }}</div>
28
+ <div class="p-4">
29
+ <a href="{{ notebook.html_path }}" class="inline-block bg-blue-500 hover:bg-blue-600 text-white py-1 px-3 rounded transition-colors">Open Notebook</a>
30
+ </div>
31
+ </div>
32
+ {% endfor %}
33
+ </div>
34
+ {% endif %}
35
+
36
+ {% if apps %}
37
+ <h2 class="text-xl font-bold text-center my-4">Apps</h2>
38
+ <p class="text-center mb-4">Interactive applications in run mode - code is hidden for a clean user interface</p>
39
+ <div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4">
40
+ {% for app in apps %}
41
+ <!-- {{ app.display_name }} App -->
42
+ <div class="bg-gray-50 border border-gray-200 rounded-lg overflow-hidden">
43
+ <div class="bg-gray-100 p-3 font-semibold">{{ app.display_name }}</div>
44
+ <div class="p-4">
45
+ <a href="{{ app.html_path }}" class="inline-block bg-amber-500 hover:bg-amber-600 text-white py-1 px-3 rounded transition-colors">Open App</a>
46
+ </div>
47
+ </div>
48
+ {% endfor %}
49
+ </div>
50
+ {% endif %}
51
+ </main>
52
+
53
+ <footer class="mt-10 pt-6 border-t border-gray-200 text-center text-sm text-gray-600">
54
+ <p class="mb-2">Built with <a href="https://marimo.io" target="_blank" class="text-blue-500 hover:underline">marimo</a> - Interactive Python notebooks</p>
55
+ </footer>
56
+ </div>
57
+ </body>
58
+ </html>