Skip to main content

Python AdminUI

Full Readme at Github Documentation 中文文档

Write professional web interface with Python.

If you need a simple web interface and you don't want to mess around with HTML, CSS, React, Angular, Webpack or other fancy Javascript frontend stuff, this project is for you. Now you can write web pages, forms, charts and dashboards with only Python.

This library is good for: data projects, tools and scripts, small IT systems and management systems, Hacker or Hackathon projects. Basically if you need an interface for your system and you don't care much about customizing the style or performance for large traffic, consider this package.

This project is based on Flask/FastApi and Ant Design Pro.

Screen Shot

Features

  • No HTML, CSS, JS needed
  • Database agnostic: feed content at your own, no matter it's MySql, Sqlite, Excel tables, Firebase or some IoT hardware
  • JWT based authentication/login system with a neat login page
  • Forms and detail pages
  • Line and Bar Chart
  • Create decent looking menus
  • Data tables with pagination
  • Adaptive to small screens and mobile devices
  • Support both Flask and FastApi

Installation and quick start

install the package with pip:

pip install adminui

The basic "form page" example:

# example_form.py
from adminui import *

app = AdminApp()

def on_submit(form_data):
    print(form_data)

@app.page('/', 'form')
def form_page():
    return [
        Form(on_submit = on_submit, content = [
            TextField('Title', required_message="The title is required!"),
            TextArea('Description'),
            FormActions(content = [
                SubmitButton('Submit')
            ])
        ])
    ]

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

Run the Python file:

python example_form.py

Then visit http://127.0.0.1:5000/ to see the result.

Use FastApi instead of Flask

Set use_fastapi=True when creating the app; and prepare() instead of run() to expose the app to uvicorn. See python/example_fastapi.py for details

# instead of app = AdminApp(), use
app = AdminApp(use_fastapi=True)

# ... other stuff you do with adminui app

# in the end of the main file, use
fastapi_app = app.prepare()

# in command line, run:
# uvicorn example_fastapi:fastapi_app

Documentation

Hosted on Read the Docs

Contributing and Development

This is a personal project. So please create issues to tell me what you need from this project.

You may also give stars to let me know if this project is worthy to invest more time on.

To work with the source code:

This project has a Typescript front-end and a Python backend.
The front-end is in the /src folder.
The back-end is in the /python folder.
To start developing:

  • cd into /python folder and run pip install -r requirements.txt to install requirements
  • run one of the example_xxx.py file in the /python folder
  • Open another terminal, run npm install & npm start at the root folder to start the frontend;

Under this development mode, requests from front-end will forward to the backend.

When you are done with developing:

  • run npm run build will build the project.

The front-end is based on the amazing Ant Design Pro library, you may consult their documentation during the development.

The Python backend is located in /python/adminui. It is Flask based. There are some examples in the /python folder.

Metadata

Release files for adminui2 1.5.6

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

Source distribution (sdist)

Source distribution for adminui2 1.5.6
File Size Uploaded
adminui2-1.5.6.tar.gz 1.2 MB Details

Built distribution (wheel)

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

Total release size: 2.4 MB

Release files / adminui2-1.5.6.tar.gz

Download URL adminui2-1.5.6.tar.gz
Size 1.2 MB
Tags Source
SHA-256 checksum
How to use checksums
2ead6eb296e53ef2b0bbc79107061e960ac3ee82480d40e59a1ccff5fc3a1305
BLAKE2b-256 checksum
How to use checksums
f337bac81d1945c93a137b778181224bae9913ab56711756e008a73a78867146
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.11.3

Release files / adminui2-1.5.6-py3-none-any.whl

Download URL adminui2-1.5.6-py3-none-any.whl
Size 1.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
902b781a1defa34e7f8e15922016568aa692f8158b7becb6953de1d57fcf32e8
BLAKE2b-256 checksum
How to use checksums
659c2d62c8f99ace2e710a08bbd3c9cf7f6e0ff1120d7a1422ff9d32ed9e476b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.11.3

Release history Release notifications | RSS feed

This release

1.5.6 This release

2 release files

1.5.5

2 release files

1.5.4

2 release files

1.5.3

2 release files

1.5.2

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