Install & Compatibility
Where this runs
tested against v0.0.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 23.1MB
glibcpy 3.10–3.910 runs
installs and imports cleanly · install 2.4s · import 0.000s · 24MB
21MB installed
● package 21MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Frontend
✓ import frontend
✗ from frontend import Frontend
This quickstart demonstrates how to initialize a `Frontend` application, define a basic `View` using a decorator for routing, and render simple HTML elements like `H1` within a `Div`. Running the script will start a local development server, typically accessible at `http://127.0.0.1:8000`.
from frontend.main import Frontend
from frontend.views import View
app = Frontend()
@app.route("/")
class MyView(View):
def render(self):
return self.Div(self.H1("Hello, Frontend!"))
if __name__ == "__main__":
# In a real application, you might run this with uvicorn directly:
# uvicorn your_module:app --reload
# For this quickstart, app.run() provides a basic server.
app.run()
Debug
Known issues
gotchaThe `frontend` library is in a very early development stage (version 0.0.x). The API surface and core components are subject to rapid and potentially breaking changes between minor versions (e.g., 0.0.3 to 0.0.4).fixPin exact versions of `frontend` in your `requirements.txt` (e.g., `frontend==0.0.3`) and review the GitHub repository's release notes or commit history carefully when upgrading.
affects: All 0.0.x versions
gotchaTo trigger UI re-renders after state changes in a `View`, you must explicitly call `self.update()` within your event handlers or state-modifying methods. Without this call, changes to instance attributes will not reflect in the browser.fixAfter modifying any state that should cause a UI update, ensure `self.update()` is called, typically at the end of the method (e.g., `def increment(self): self.count += 1; self.update()`).
affects: All 0.0.x versions
gotchaThe `app.run()` method provided in quickstarts is suitable for basic local development and testing. For production deployments or more robust development setups, it's recommended to use a standard ASGI server like `uvicorn`.fixInstead of `app.run()`, install `uvicorn` (`pip install uvicorn`) and run your application using `uvicorn your_module_name:app --reload` (replace `your_module_name` with the actual Python file name).
affects: All 0.0.x versions
Upgrade
Version history
0.0.3latest on PyPI · released Apr 15, 2020
Audit
Dependencies
pydanticrequiredUsed for data validation and modeling within the framework's core.