nicegui README

The project's README from github.com/zauberzeug/nicegui. As one markdown file: README.md.

Try online!

NiceGUI

NiceGUI is an easy-to-use, Python-based UI framework, which shows up in your web browser. You can create buttons, dialogs, Markdown, 3D scenes, plots and much more.

It is great for micro web apps, dashboards, robotics projects, smart home solutions and similar use cases. You can also use it in development, for example when tweaking/configuring a machine learning algorithm or tuning motor controllers.

NiceGUI is available as PyPI package, Docker image and on conda-forge as well as GitHub.

PyPI PyPI downloads Conda version Conda downloads Docker pulls
GitHub license GitHub commit activity GitHub issues GitHub forks GitHub stars DOI

Features

Installation

python3 -m pip install nicegui

Usage

Write your nice GUI in a file main.py:

from nicegui import ui

ui.label('Hello NiceGUI!')
ui.button('BUTTON', on_click=lambda: ui.notify('button was pressed'))

ui.run()

Launch it with:

python3 main.py

The GUI is now available through http://localhost:8080/ in your browser. Note: NiceGUI will automatically reload the page when you modify the code.

Documentation and Examples

The documentation is hosted at https://nicegui.io/documentation and provides plenty of live demos. The whole content of https://nicegui.io is implemented with NiceGUI itself and can be started locally with docker run -p 8080:8080 zauberzeug/nicegui or by executing main.py from this repository.

You may also have a look at our in-depth examples of what you can do with NiceGUI. In our wiki we have a list of great NiceGUI projects from the community, a section with Tutorials and a growing list of FAQs. When building NiceGUI projects with AI assistants, point them at nicegui/llms.md — a concise reference that ships with the package (also served at https://nicegui.io/llms.txt).

Why?

We at Zauberzeug like Streamlit but find it does too much magic when it comes to state handling. In search for an alternative nice library to write simple graphical user interfaces in Python we discovered JustPy. Although we liked the approach, it is too "low-level HTML" for our daily usage. But it inspired us to use Vue and Quasar for the frontend.

We have built on top of FastAPI, which itself is based on the ASGI framework Starlette and the ASGI webserver Uvicorn because of their great performance and ease of use.

Sponsors

Maintenance of this project is made possible by all the contributors and sponsors. If you would like to support this project and have your avatar or company logo appear below, please sponsor us. 💖

Lechler GmbH Zhifeng Wayne Houlden DigiQuip AS JACOB SHI TestMu AI Open Source Office (Formerly LambdaTest) Zaga Solutions DiscoLike Inc.

Consider this low-barrier form of contribution yourself. Your support is much appreciated.

Contributing

Thank you for your interest in contributing to NiceGUI! We are thrilled to have you on board and appreciate your efforts to make this project even better.

As a growing open-source project, we understand that it takes a community effort to achieve our goals. That's why we welcome all kinds of contributions, no matter how small or big they are. Whether it's adding new features, fixing bugs, improving documentation, or suggesting new ideas, we believe that every contribution counts and adds value to our project.

We have provided a detailed guide on how to contribute to NiceGUI in our CONTRIBUTING.md file. We encourage you to read it carefully before making any contributions to ensure that your work aligns with the project's goals and standards.

If you have any questions or need help with anything, please don't hesitate to reach out to us. We are always here to support and guide you through the contribution process.

Included Web Dependencies

See DEPENDENCIES.md for a list of web frameworks NiceGUI depends on.

Architecture

NiceGUI is a Python framework for building web UIs with a backend-first philosophy. Key architectural decisions:

nicegui (zauberzeug/nicegui)

Searching Database…

16.3K ·GitHub
Что это такое?NiceGUI — простой в использовании фреймворк на Python, который открывается в веб-браузере. С его помощью можно создавать кнопки, диалоговые окна, 3D-сцены, графики, дашборды и многое другое, не написав фронтенд-код самостоятельно.
Нужно ли знать HTML или JavaScript, чтобы пользоваться этим?Нет. NiceGUI работает по принципу «сначала бэкенд»: вся логика интерфейса находится в вашем Python-коде, а веб-часть фреймворк берёт на себя. Внутри работает бэкенд на Python/FastAPI с фронтендом на Vue/Quasar, а синхронизация идёт через socket.io.
Как всё запустить?Установите пакет из PyPI, напишите интерфейс в файле вроде main.py и запустите его командой ui.run(). Браузер откроется автоматически, а страница будет перезагружаться при каждом изменении кода.
Что нужно установить помимо самого Python?Ничего, кроме самого Python. NiceGUI распространяется как пакет PyPI, Docker-образ и через conda-forge, так что можно выбрать тот вариант, который подходит вашему рабочему процессу.
Масштабируется ли он на несколько процессов при большой нагрузке?NiceGUI намеренно работает на одном воркере uvicorn и опирается на полноценную поддержку async, а не на синхронизацию нескольких процессов. Это осознанное архитектурное решение, а не ошибка, но его стоит учитывать при развёртываниях с очень большим числом одновременных соединений.
Можно ли превратить приложение в настольное, а не в сайт?Да. Тот же код может работать как веб-сервер, к которому обращаются через браузер, или в нативном режиме, когда открывается обычное окно настольного приложения.
Какие элементы интерфейса есть из коробки?Стандартные элементы вроде подписей, кнопок, чекбоксов, ползунков и загрузки файлов, а также продвинутые — для построения графиков, отрисовки 3D-сцен, виртуальных джойстиков, аннотирования изображений, таблиц, сворачиваемых деревьев и встраивания видео и аудио.
Можно ли использовать его в блокнотах Jupyter?Да, NiceGUI работает прямо в Jupyter Notebook и поддерживает интерактивный режим Python.
Обновляется ли интерфейс автоматически при изменении данных?Да, есть простая привязка данных и обновляемые функции (refreshable), благодаря которым интерфейс обновляется с меньшим количеством шаблонного кода.
Для чего он подходит помимо обычных веб-приложений?Он ориентирован на микро-веб-приложения, дашборды, робототехнические проекты и решения для умного дома, а также удобен на этапе разработки, например для настройки алгоритмов машинного обучения или подстройки контроллеров моторов.
Creator
zauberzeug
Size
129.1 MB
Stars
16.3K
Age
5y
Commits · 90 Days