Skip to main content

Python Bootwrap

Python + Bootstrap = Bootwrap

Continuous Integration Status Code Coverage Percentage Codacy Badge Project License Project Documentation

Bootwrap is a Python library for rapid developing of web-based user interfaces (WebUI). It helps creating WebUI using Python code only and can be used in conjunction with different web-development frameworks such as Flask. Under the hood, this library wraps one of the most popular front-end toolkit Bootstrap.

As a showcase of what this library is capable of please check the documentation. The entire documentation web interface is created using the Bootwrap.

Installing

Install and update using pip:

~$ pip install bootwrap

Bootwrap package has no external dependencies!

Why & where you might use Bootwrap?

The vast majority of web applications consist of frontend and backend. If you are a small team or even a solo developer you need to divide resources and time to focus on both parts. This often results in switching between different platforms such as Python and React, AngularJs, Flask templates (HTML, CSS, JS), etc. But what if your main focus is the backend and you also don't want to compromise on the quality of your WebUI. In this case, the Bootwrap library is for you! It will help you develop WebUI without leaving the Python ecosystem and not waste your time on HTML, CSS, and Javascript. To understand its capability just clone the project and run the demo application ":pig: PiggyBank".

Screenshots Collage

For more information also read the Bootwrap documentation.

Hello World Application

The following code will create three pages application with a top-level menu bar for navigations. Since this application is based on Flask make sure that you installed it as well.

from flask import Flask
from markupsafe import Markup
from bootwrap import Page, Menu, Image, Anchor, Button, Text

app = Flask(__name__, static_folder='docs', static_url_path='')

LOGO = 'https://github.com/mmgalushka/bootwrap/blob/main/docs/logo.png?raw=true'
FAVICON = 'https://raw.githubusercontent.com/mmgalushka/bootwrap/main/docs/favicon.ico'

class MyMenu(Menu):
    def __init__(self):
        super().__init__(
            logo=Image(LOGO, width=32, alt='Logo'),
            brand=Text('Bootwrap').as_strong().as_light().ms(2),
            anchors=[
                Anchor('Home').link('/'),
                Anchor('About').link('/about')
            ], 
            actions=[
                Button('Sign In').as_outline().as_light().link('/signin')
            ]
        )

class MyPage(Page):
    def __init__(self, container):
        super().__init__(
            favicon = FAVICON,
            title='Hello World Application',
            menu=MyMenu(),
            container=container
        )

@app.route('/')
def home():
    return Markup(MyPage(container=Text('Home').as_heading(1)))

@app.route('/about')
def about():
    return Markup(MyPage(container=Text('About').as_heading(1)))

@app.route('/signin')
def signin():
    return Markup(MyPage(container=Text('Sign In').as_heading(1)))

if __name__ == '__main__':
    app.run(debug=True)

Use the following command to launch the application.

$ flask run
  * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)

The result should look like.

Simple Example

Contributing

For information on how to set up a development environment and how to make a contribution to Bootwrap, see the contributing guidelines.

Links

Metadata

Release files for bootwrap 1.2.10

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

Source distribution (sdist)

Source distribution for bootwrap 1.2.10
File Size Uploaded
bootwrap-1.2.10.tar.gz 1.8 MB Details

Built distribution (wheel)

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

Total release size: 1.8 MB

Release files / bootwrap-1.2.10.tar.gz

Download URL bootwrap-1.2.10.tar.gz
Size 1.8 MB
Tags Source
SHA-256 checksum
How to use checksums
688d33eb1cef4a0bdee42fdc243dd356b5823998f240c3b8725d39238afb2cd4
BLAKE2b-256 checksum
How to use checksums
6e114833a1ef75ff516f8148042039905ab26e731751129d11e9c4c480f8e44a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / bootwrap-1.2.10-py3-none-any.whl

Download URL bootwrap-1.2.10-py3-none-any.whl
Size 53.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
10eab77a10d272824a4ac7c30d9f8e72aaf72d86ee382e8ba066820d25821430
BLAKE2b-256 checksum
How to use checksums
2f6d82b4de684f2f41b497a1438aaaf8349f60980bd8d4f0e361d34f93452fb3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release history Release notifications | RSS feed

This release

1.2.10 This release

2 release files

1.2.9

2 release files

1.2.8

2 release files

1.2.7

2 release files

1.2.6

2 release files

1.2.5

2 release files

1.2.4

2 release files

1.2.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 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