Skip to content

About

Python Frontend Framework, a web development utility designed to build interactive user interfaces and client-side applications using Python syntax. It provides a seamless user experience to help developers create reactive web components, handle browser events, and deploy full-stack Python apps effortlessly.

Topics

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

Python Frontend Framework

Header

Version Downloads License Platform


🐍 The Power Of Python, The Speed Of The Web

For decades, JavaScript has been the undisputed king of the frontend. If you wanted to build a dynamic, interactive web application, you had no choice but to learn React, Vue, or Angular. But what if you could build stunning user interfaces using only Python?

Python Frontend Framework is a revolutionary, open-source library that brings the simplicity and power of Python directly to the browser. By leveraging WebAssembly (WASM) and Pyodide, this framework allows you to write your entire application logic in Python. There is no need for complex toolchains, npm installs, or node_modules.

This repository provides a complete toolkit for building Single Page Applications (SPAs). It includes a virtual DOM, a reactive state management system, and a component-based architecture similar to React. Whether you are a data scientist wanting to build a dashboard for your machine learning model, or a backend developer tired of context-switching to JavaScript, this framework is a game-changer.

images (31)

✨ Core Features

Feature Description
🐍 Pure Python Write your frontend components entirely in Python
⚑ Zero JavaScript No need to learn or write any JavaScript or TypeScript
🧠 Reactive State Automatic UI updates when your Python variables change
🧩 Component Based Build reusable UI elements with simple Python classes
πŸš€ WebAssembly Powered Runs in the browser at near-native speeds via Pyodide
πŸ“¦ Batteries Included Built-in routing, state management, and form handling
🎨 CSS Support Easily style your components using standard CSS files
πŸ› οΈ Developer Friendly Hot module replacement and a powerful CLI

πŸš€ Quick Setup

To get started, you will need Python 3.10+ and a modern web browser. The framework uses a custom CLI to scaffold and run your project.

# Install the framework CLI globally
pip install pyfront-cli

# Create a new project
pyfront create my-app

# Navigate into your new project
cd my-app

# Start the development server
pyfront dev

Once the server is running, open your browser and navigate to http://localhost:8000. You will see a default "Hello World" application. Open the app.py file, change the text, and watch as the browser instantly updates without a page refresh.


πŸ”— Ready to build with Python?

Get Framework


🧠 Under The Hood: How Python Runs In The Browser

You might be wondering: "How can Python run in a browser that only understands JavaScript?" The answer is Pyodide, a port of CPython to WebAssembly. Pyodide compiles the entire Python interpreter into a .wasm binary that the browser can execute.

When your user loads your web page, the browser downloads the Pyodide runtime and your Python code. The framework then initializes a virtual DOM (a lightweight representation of the UI). When you update a variable in your Python code, the framework calculates the difference between the old and new UI states and applies only the necessary changes to the real DOM.

To ensure the app feels snappy, we use Web Workers. The Python interpreter runs in a separate background thread, preventing the main UI thread from freezing during heavy computations. The communication between the Python worker and the main JavaScript thread is handled via a highly optimized message-passing protocol.


βš™οΈ Need a detailed configuration guide?

Setup Guide


πŸ› οΈ Tech Stack

Python WebAssembly Pyodide JavaScript HTML5 Git


🀝 Community & Contributing

We are pioneering a new way to build for the web. If you have ideas for new components, improvements to the virtual DOM, or want to help optimize the Pyodide runtime, we welcome your contributions!

  1. Fork the repository.
  2. Create your feature branch (git checkout -b feature/new-component).
  3. Commit your changes (git commit -m 'Add new component').
  4. Push to the branch (git push origin feature/new-component).
  5. Open a Pull Request.

Please read our CONTRIBUTING.md for detailed coding standards and testing requirements. We also have an active Discord server where you can share your projects, ask for help with Pyodide configuration, and discuss the latest trends in web development.


πŸ“¬ Contact & Support

  • πŸ’¬ Discussions: Join the conversation in the GitHub Discussions tab.
  • πŸ› Issues: Found a bug? Let us know via the Issues tracker.
  • πŸ“§ Email: Reach out directly at support@python-frontend.dev.

⭐ If this framework changes your workflow, give it a star! ⭐

Star


πŸš€ Start building your Python UI today

Get Started

Crafted with precision and ❀️ by the Python Frontend Framework community

Footer

About

Python Frontend Framework, a web development utility designed to build interactive user interfaces and client-side applications using Python syntax. It provides a seamless user experience to help developers create reactive web components, handle browser events, and deploy full-stack Python apps effortlessly.

Topics

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors