Skip to content

This repo is a compilation of tutorials and examples using PyScript which embeds python into HTML.

Notifications You must be signed in to change notification settings

ADolbyB/pyscript-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

PyScript Examples


This repo is a compilation of tutorials and examples using PyScript which embeds python into HTML. PyScript is a 'micro front-end', similar to Angular or React.

I created this repo for project research on Python Web Apps.

Prerequisites for using PyScript:

Optional but highly recommended:

  • Install the Node Version Manager: NVM

    • This allows multiple versions of NPM to be installed as parallel installations.
  • Install a Python Environment Management system like Anaconda or Miniconda.

    • This allows multiple versions of Python to be installed as parallel environments.
  • Add the mamba package dependency solver, which is much faster than the pre-existing conda package dependency solver: conda install mamba

    • Refer to the docs for mamba
  • Another alternative is the Miniforge3 aka MambaForge which "holds the minimal installers for Conda and Mamba specific to conda-forge, with the following features pre-configured:

    • Packages in the base environment are obtained from the conda-forge channel.
    • The conda-forge channel is set as the default (and only) channel."

Some Background Information:

  • Note that with PyScript, the <py-script> tag that is used to run python code. This is the 'main' tag used.
    • <py-script> is used to display results (output, pyscrit.write), DOM Manipulation, and other python based operations (like batch, webservices).
    • <py-script> is used in two ways: Python code written in HTML in the same page, or using src attributes in the tag (externalization of python code).
  • The <py-env> tag is used to import Python Libraries into the DOM.
  • The <py-repl> tag is used to add a python terminal to the DOM.

Sources:

Documentation (start here):

Video Tutorials:

  • PyScript: The Complete Guide by Run Nano, 2:03:00 duration.
    • Covers the following: DOM Manipulation, CRUD Operations, Event Management, Custom Components, and Data Science Applications.

Tutorial Articles:

Status:

GitHub repo size

About

This repo is a compilation of tutorials and examples using PyScript which embeds python into HTML.

Topics

Resources

Stars

Watchers

Forks