What is WebComPy

WebComPy is a Python frontend framework for PyScript with the following features.
  • Component-based declarative rendering
  • Automatic DOM refreshing
  • Built-in router
  • CLI tools (Project scaffolding, Dev server, Static Site Generator)
  • Dependency management with lock file sync

Get started with uv (Recommended)

Create a new project and set up dependencies using uv.
Add browser dependencies to [project.optional-dependencies] in pyproject.toml:
Configure webcompy_config.py with LockfileSyncConfig:
Generate the lock file and start the dev server:

Get started with Poetry

If you prefer Poetry, use the following setup:
Add browser dependencies to [project.optional-dependencies] in pyproject.toml (same as the uv setup above).
Then configure webcompy_config.py as shown above, and run:
Note: webcompy lock --install uses uv pip or pip, not poetry install. Use webcompy lock --sync to compare versions with pyproject.toml.

Lock File Commands

CommandDescription
webcompy lockGenerate or update the lock file
webcompy lock --exportExport lock file dependencies to requirements.txt
webcompy lock --syncCompare lock file with pyproject.toml / requirements.txt
webcompy lock --installExport and install lock file dependencies

Source Code