How xdmanus1/hpy-framework works
Project type and purpose
• Project Type: An open-source CLI tool and library for scaffolding, building, serving, and live-reloading Brython-based web applications.
• Purpose: Read a root directory of .hpy+Python+static files; parse templates and Brython code; produce standard HTML/JS output; serve locally with live reload.
File structure
• Top-level CLI entry point: hpy_tool.py and pyproject.toml/setup.py.
• Core library in hpy_core/ with submodules:
• cli.py – command definitions (init, build, serve, watch).
• config.py – loads hpy.toml.
• parsing.py – parses .hpy templates, <python> blocks, styles, head/body fragments.
• building.py – assembles pages into final HTML using _app.html and _layout.hpy, collects assets.
• serving.py – HTTP server for dev mode.
• watching.py – file-watch + live-reload orchestration.
• project_templates/ – scaffolding templates for hpy init.
• Documentation site in docs/ and example projects in examples/.
• Tests in tests/.
README for additional insights
• Core features: project init, config, directory-based workflow, layout support, asset handling, Brython integration, dev/prod build modes, serve/watch.
• Workflow: read hpy.toml → identify input/output dirs → copy static → parse layout & pages → inject into shell → write output → (optionally) serve or watch.
• Technologies: Python CLI (Typer), watchfiles, tomli, Brython (client).