Skip to main content

Fronty - A frontend web framework

Created by @Almas-Ali

Learn from the official Documentation

Table of Contents

What is Fronty?

Fronty is a frontend web framework. It is a Python library that allows you to create web pages using only Python. No HTML, CSS, or JavaScript required. But you can still use them if you want. Basic knowledge of HTML, CSS, and JavaScript is required to use Fronty.

Installation

Easy to install with pip.

pip install fronty

Example Projects

Starter Project

Screenshort_1

Bootstrap Integration

Screenshort_1

Custom CSS Project

Screenshort_1

Screenshort_2

How to run the example projects

  1. Clone the repository
git clone https://github.com/Almas-Ali/fronty.git
  1. Go to the example project directory
cd fronty/examples/starter\ project
  1. Run the project
python app.py

Note: You have to install a backend server to run the project. Fronty does not provide a backend server. You can use any backend server you want. For example, you can use Flask. You can also use Fronty with Django. But you have to install Django first. For simplicity, we have used Flask in the example projects. We are woring on a backend server for Fronty. It will be available soon.

How to create a new project

  1. Create a new directory
mkdir my_project
  1. Go to the directory
cd my_project
  1. Create a new file named app.py
touch app.py
  1. Open the file with your favorite text editor

  2. Copy the following code and paste it in the file

from flask import Flask, request
from fronty.html import *

app = Flask(__name__)


def home(request) -> Html:
    '''This is the home page view function'''
    return Html(
        Head(
            Title('Home'),
            Meta(charset='utf-8'),
            Meta(name='viewport', content='width=device-width, initial-scale=1'),
        ),
        Body(
            Element(
                'center',
                Element(
                    'h1',
                    'Welcome to Fronty!'
                ),
                Element(
                    'p',
                    'Fronty is a frontend web framework.'
                ),
            )
        )
    )


@app.route('/')
def index() -> str:
    '''This is the home page view function'''
    return home(
        request=request,
    ).render()


if __name__ == '__main__':
    app.run(debug=True)
  1. Run the project
python app.py
  1. Open the browser and go to http://127.0.0.1:5000/

Screenshort_1

Contributing

Pull requests are welcome. For any changes, please open an issue first to discuss what you would like to change.

Thanks for using Fronty!

Metadata

Release files for fronty 0.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fronty 0.0.7
File Size Uploaded
fronty-0.0.7.tar.gz 263.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fronty 0.0.7
File Interpreter ABI Platform
fronty-0.0.7-py3-none-any.whl Python 3 none any Details

Total release size: 275.0 kB

Release files / fronty-0.0.7.tar.gz

Download URL fronty-0.0.7.tar.gz
Size 263.8 kB
Tags Source
SHA-256 checksum
How to use checksums
a34d02c6eddf5fde556a4b10708fbb3005d239a8d1ebb88ec38d4b2938d641bc
BLAKE2b-256 checksum
How to use checksums
a36fe42c59b456116e67377038118cb580ae9290dbe38beebd5ff7f7b45ab4da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release files / fronty-0.0.7-py3-none-any.whl

Download URL fronty-0.0.7-py3-none-any.whl
Size 11.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
21e96cf2ae9a0bcc8891c858383cf50d06479d20e3a90186bb2fd8e4ad0d90b6
BLAKE2b-256 checksum
How to use checksums
2629954655b03053877aaf9525a1a2a0150f233fbbefcc0439ea47b69b3b2620
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release history Release notifications | RSS feed

This release

0.0.7 This release

2 release files

0.0.6

2 release files

0.0.5

3 release files

0.0.4

3 release files

0.0.3

3 release files

0.0.2

3 release files

0.0.1

3 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page