templates and pyscript wrappers for various bootstrap properties
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Jonas Weinz 75efac61b9 updated readmy 4 months ago
dist update examples 4 months ago
examples update examples 4 months ago
img add some documentation 4 months ago
pyscript_bootstrap_templates change default package path to github 4 months ago
.gitignore Initial commit 1 year ago
LICENSE Initial commit 1 year ago
MANIFEST.IN initial pwa support 12 months ago
README.md updated readmy 4 months ago
build.sh many small improvements 4 months ago
setup.py forgot to add setup.py 12 months ago

README.md

pyscript-bootstrap-templates

This package provides tools to write single page Dashboard apps with python that run entirely client-side in the Browser. To do this, it uses pyscript and builds python wrapper classes for various bootstrap elements.

image-20230604191240295

installation

pip install git+https://github.com/antielektron/pyscript_bootstrap_templates.git

usage

create a project

to create a new project, run

pyscript_bootstrap_app create <project_name> <title> --packages PACKAGES [PACKAGES ...]
  • this will create a new folder containing a PWA app skeleton to start with. The main entry point should be in main.py

  • this will also create all necessary files such that this app can operate as an standalone PWA application.

  • the packages parameter is optional, you can specify on which PyPi packages your code depends

update a project

Since it's a pwa, browsers will cache all content of the app for offline usage. To bump the version of the PWA and trigger a redownload after the project has changed, simply run

pyscript_bootstrap_app update <project_name> <title>

serving a project for development

you can use python's builtin webserver to serve the files locally for testing. Just run

python -m http.server 1111

inside your project folder and navigate to http://localhost:1111 in your browser

advanced usage

There are a few more options you can pass to pyscript_bootstrap_app (e.g. the pyscript version that is used). Here is the full list:

usage: pyscript_bootstrap_app [-h] [--packages PACKAGES [PACKAGES ...]] [--paths PATHS [PATHS ...]] [--pyscript-css-url PYSCRIPT_CSS_URL] [--pyscript-js-url PYSCRIPT_JS_URL]
                              [--pyscript-py-url PYSCRIPT_PY_URL] [--bootstrap-css-url BOOTSTRAP_CSS_URL] [--bootstrap-js-url BOOTSTRAP_JS_URL]
                              [--pyscript-bootstrap-templates-wheel-url PYSCRIPT_BOOTSTRAP_TEMPLATES_WHEEL_URL] [--pwa-bg-color PWA_BG_COLOR] [--pwa-theme-color PWA_THEME_COLOR]
                              {create,update} root_folder title

create a new pyscript project

positional arguments:
  {create,update}
  root_folder           the root folder of the new project
  title                 the title of the new project

options:
  -h, --help            show this help message and exit
  --packages PACKAGES [PACKAGES ...]
                        the packages to include in the new project
  --paths PATHS [PATHS ...]
                        additional local python files to include in the new project
  --pyscript-css-url PYSCRIPT_CSS_URL
                        the url of the pyscript css file
  --pyscript-js-url PYSCRIPT_JS_URL
                        the url of the pyscript js file
  --pyscript-py-url PYSCRIPT_PY_URL
                        the url of the pyscript py file
  --bootstrap-css-url BOOTSTRAP_CSS_URL
                        the url of the bootstrap css file
  --bootstrap-js-url BOOTSTRAP_JS_URL
                        the url of the bootstrap js file
  --pyscript-bootstrap-templates-wheel-url PYSCRIPT_BOOTSTRAP_TEMPLATES_WHEEL_URL
                        the url of the pyscript bootstrap templates wheel file
  --pwa-bg-color PWA_BG_COLOR
                        background color for pwa configuration
  --pwa-theme-color PWA_THEME_COLOR
                        theme color for pwa configuration