Config-driven HTMLPY/CSSPY application engine backed by a C renderer.
Project description
PAMM UI
PAMM UI is a Python package and CLI for building desktop-style apps with .htmlpy and .csspy files, Python logic, and a native C rendering engine.
It gives you:
- a reusable Python library
- a
pammterminal command - project scaffolding
- config-driven startup
- development autoreload
- formatting and VS Code setup helpers
Install
From PyPI
pip install pamm_ui
After install:
pamm --help
Editable local install
python -m pip install -e .
Install release tools
python -m pip install -e .[release]
Use As A Package
You can import PAMM UI in any Python project after installation:
from pamm_ui import Application, ProjectConfig, create_project, run_from_config
run_from_config("app.json", dev=True)
You can also run the package directly:
python -m pamm_ui --help
python -m py_engine --help
CLI Commands
Create a project
pamm create my_app
You can choose another target directory:
pamm create my_app --dir D:\projects\my_app
You can also force autoreload on or off:
pamm create my_app --autoreload yes
pamm create my_app --autoreload no
Run a project
pamm run my_app\app.json
Run in development mode:
pamm run my_app\app.json --dev
Development mode
pamm dev my_app\app.json
Doctor
Check installation and project health:
pamm doctor
pamm doctor my_app\app.json
Try safe fixes too:
pamm doctor my_app\app.json --fix
Format
Format Python, .htmlpy, and .csspy:
pamm format .
pamm format my_app
Setup Dev
Write workspace settings for VS Code and optionally install helpful tools:
pamm setup-dev .
pamm setup-dev my_app
pamm setup-dev my_app --install-python-tools
Skip extension installation if you only want workspace settings:
pamm setup-dev my_app --no-extensions
Project Structure
pamm create generates a project like this:
my_app/
app.json
main.py
README.md
frontend/
app_logic.py
assets/
app_icon.bmp
showcase.bmp
components/
sidebar.htmlpy
db/
config.py
layouts/
shell.htmlpy
pages/
app.htmlpy
home.htmlpy
public/
styles/
app.csspy
base.csspy
theme.csspy
backend/
main.py
services.py
.vscode/
launch.json
settings.json
Config File
PAMM UI apps are started from app.json.
Example:
{
"app_name": "my_app",
"html": "frontend/pages/app.htmlpy",
"css": [
"frontend/styles/base.csspy",
"frontend/styles/theme.csspy",
"frontend/styles/app.csspy"
],
"logic": [
"main.py",
"frontend/app_logic.py",
"backend/main.py",
"backend/services.py"
],
"dll_path": null,
"frontend_dir": "frontend",
"backend_dir": "backend",
"dev_mode": true,
"autoreload": true,
"watch": [
"frontend",
"backend",
"main.py"
]
}
Important fields:
html: main.htmlpyentry filecss: one or more.csspyfileslogic: one or more Python files loaded by the appdll_path: optional override for a custom engine DLL pathautoreload: reload changed content during developmentwatch: files or folders watched in dev mode
HTMLPY And CSSPY
.htmlpy files define structure:
<mainwin title="Dashboard">
<cwin id="card1">
<label text="Card 1" />
<button text="Click Me" on_click="card1_click" />
</cwin>
<cwin id="card2">
<label text="Card 2" />
<button text="Click Me" on_click="card2_click" />
</cwin>
</mainwin>
.csspy files define styles:
mainwin {
background: #0f1522;
}
.panel {
background: #131d2f;
border-radius: 28px;
}
button:hover {
background: #476089;
}
Generated Main Entry
Each generated project includes main.py, so a developer can also start the app with:
python main.py
That file tries the installed package first and falls back to a nearby source checkout if needed.
Editor Support
PAMM UI writes VS Code settings that:
- map
*.htmlpyto HTML - map
*.csspyto CSS - enable format-on-save
- enable Black for Python
- enable Ruff fixes and import cleanup
Recommended VS Code extensions:
ms-python.pythonms-python.black-formattercharliermarsh.ruff
Library API
Run from config
from pamm_ui import run_from_config
run_from_config("app.json", dev=True)
Create projects from code
from pamm_ui import create_project
create_project("sample_app")
Build your own app object
from pamm_ui import Application, ProjectConfig
config = ProjectConfig.from_file("app.json")
app = Application()
app.load_project(config)
app.run()
Cross-Project Usage
Once installed, PAMM is meant to work from any project folder, not only this repository.
Typical flow:
- Install PAMM into your Python environment.
- Run
pamm create my_app. - Open the new project.
- Run
pamm dev app.json. - Edit
.htmlpy,.csspy, and.pyfiles.
Publish To PyPI
PAMM UI is now set up to be packaged for PyPI and released from GitHub.
Build locally
python -m pip install -e .[release]
python -m build
python -m twine check dist/*
Upload manually
python -m twine upload dist/*
GitHub Actions
This repo includes:
Recommended release flow:
- Create a GitHub repository for PAMM UI.
- Push this code to GitHub.
- Create or publish the
pamm_uiproject on PyPI. - Configure PyPI trusted publishing for your GitHub repo.
- Publish a GitHub release.
- Let GitHub Actions build and upload the package.
Detailed release notes are in RELEASE.md.
Local Repo Entry Points
If you are working inside this repository and have not installed the package globally yet, these still work:
python run_app.py create my_app
python run_app.py run my_app\app.json --dev
python pamm.py --help
Notes
- The Python package is installable as
pamm_ui. - The importable helper modules are available through
pamm_ui.pyandpamm.py. - The engine is still evolving, so some advanced widgets are scaffolded more than fully browser-grade today.
- The packaged install currently includes a Windows engine DLL.
- Linux and macOS support still need native engine packaging work before a full plug-and-play PyPI install is honest on those platforms.
- Live PyPI publishing still requires your PyPI account setup or trusted publishing configuration.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pamm_ui-0.1.0.tar.gz.
File metadata
- Download URL: pamm_ui-0.1.0.tar.gz
- Upload date:
- Size: 87.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fea9bfd548d59595ab6b5efe161652b0479b39b9915377a303ea21b7e2c396e3
|
|
| MD5 |
cb3827e9789a2cbfdc8218f0245125fa
|
|
| BLAKE2b-256 |
57d011abf683d5467d239fc99e60f0a799cd0972c5e5411c548eb968a004f70e
|
File details
Details for the file pamm_ui-0.1.0-cp311-cp311-win_amd64.whl.
File metadata
- Download URL: pamm_ui-0.1.0-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 76.2 kB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8e73c8d671cfb8fb7d2add37bc298caf5f1c3c20895b781f5ef45edbccdcc441
|
|
| MD5 |
3115da46e77fec6902308d44c61d7f6b
|
|
| BLAKE2b-256 |
3133bd7e801bc298ddb64994c23f05f1287f5fe6049de09e52de38ca718ec320
|