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:
Then configure
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
| Command | Description |
|---|---|
webcompy lock | Generate or update the lock file |
webcompy lock --export | Export lock file dependencies to requirements.txt |
webcompy lock --sync | Compare lock file with pyproject.toml / requirements.txt |
webcompy lock --install | Export and install lock file dependencies |