Skip to main content

A powerful multibackend GUI framework for Python. Made for declarative UI creation

Project description

Example1

alt text

Wiki link(BETA!)

Nevu UI means: Nevu is Eleven times better Versus other UI's User Interface

Brief Description

Nevu UI is a library for the declarative creation of user interfaces in python. The project aims to provide developers with a set of ready-made, stylable, and extensible components for the rapid creation of modern and responsive interfaces in games and multimedia applications.

The main goal of Nevu UI: to make creating interfaces in python easier and faster

Key features include:

  • Layout system: Convenient arrangement of elements, for example, using grids (Grid) and scrollable containers (ScrollableColumn).
  • Set of widgets: Ready-to-use elements such as buttons, input fields, and labels.
  • Flexible styling: The ability to customize the appearance through a style system that supports colors, gradients, and borders.
  • Animations: Built-in support for animations to create dynamic and lively interfaces.
  • Declarativeness: Support for declarative interface creation

Style

Style - storage of parameters for customizing the appearance

Editable parameters:

  • Gradient
  • ColorTheme - Analogous to MaterialDesign, there is a ready-made set of themes - ColorThemeLibrary
  • Font name/size
  • Border Width/Radius
  • Text Align X/Y
  • Transparency

Main Features

Nevu UI allows you to describe an interface with a clear structure

Examples of declarativeness:

  • Declarative approach: Describe your interface just as you see it.
    # Specify content directly when creating the layout
    grid = ui.Grid(content={(1,1): ui.Button(...)})
    
  • Adaptive size system (SizeRules): Forget about pixels. Use relative values that adjust to the size of the window or parent element.
    • vh / vw: Percentage of the window's height/width.
    • fillx / filly / fill: Percentage of the parent layout's height/width/size.
    • gc / gcw / gch: Percentage of the grid cell size.
    • Prefix c: can be placed in any SizeRule, it means that the current value will be taken (without the prefix, the original will be taken).
  • Powerful style system: Customize every aspect of the appearance using the universal Style object.
    • Themes: Ready-made color themes in ColorThemeLibrary.
    • Gradients: Support for linear and radial.
    • Image: Support for a background image via the bgimage parameter.
    • And much more: Fonts, borders, rounding, transparency.
  • Built-in animations: Bring your interface to life with ready-made animations for movement, transparency, etc.
    • 25+ built-in animations
    • There are 2 types of animations:
      • Start - Allows you to set the initial appearance of the widget.
      • Infinite - Produces an infinite animation defined in animation_manager.
    • Usage example:
      • Start: widget.animation_manager.add_start_animation(ui.animations.EaseOut(...))
      • Infinite: widget.animation_manager.add_continuous_animation(ui.animations.EaseOut(...))

Parameter System (ParamEngine):

  • ParamEngine is a convenient tool built into all layouts and widgets, it allows you to:
    • Declaratively add variables to the object's __init__
    • Check the variable type during initialization and after
    • Integrate a parameter into different stages of initialization
    • Retrieve parameter values via self.get_param(param_name).get()
    • Set parameter values via self.get_param(param_name).set(value)
  • Examples:
    import nevu_ui as ui
    from typing import Unpack, NotRequired
    
    #Create a TypedDict with variables (optional, but looks nice)
    class MyWidgetKwargs(ui.WidgetKwargs):
        my_var: NotRequired[int | float]
    
    class MyWidget(ui.Widget):
        def __init__(self, size: NvVector2 | list, style: Style = default_style, **param_kwargs: Unpack[MyWidgetKwargs]):
            super().__init__(size, style, **param_kwargs)
    
        #Override the function to add parameters (mandatory)
        def _add_params(self):
            super()._add_params()
    
            #Add a parameter (mandatory)
            self._add_param('my_var', int | float)
    
            #You can also add a link to a parameter
            #self._add_param_link('my_var', 'my_var_new_name')
    
            #You can also block a parameter if necessary
            #self._block_param('my_var')
    

Installation

Dependencies:

Python >= 3.12.*

  • For Building:
    • setuptools >= 61.0
    • Cython
    • numpy
  • For Running:
    • numpy
    • Pillow
  • Additional libraries:
    • pygame-ce>=2.3.0
    • raylib
    • pyyaml

Installation via pip

pip install nevu-ui[all]

Examples

Example1

Example2

Example3


Basic Grid

Declarative Approach

import nevu_ui as ui #Import Nevu UI
import pygame

pygame.init()

class MyGame(ui.Manager): #Create the base of our application
    def __init__(self):
        super().__init__(ui.Window((400, 300), title = "My Game")) #Initialize the manager
        style = ui.Style(borderradius=20, colortheme=ui.ColorThemeLibrary.material3_dark) #Create Style (optional)
        self.menu = ui.Menu(self.window, [100%ui.vw, 100%ui.vh], style = style, #Create a menu
                            layout= ui.Grid([100%ui.vw, 100%ui.vh], row=3, column=3, #Create a grid layout
                                            content = {
                                                (2, 2): ui.Button(lambda: print("You clicked!"), "BUTTON!", [50%ui.fill, 50%ui.gc], style=style) #Create a button
                                            }
                                            )
                            )
    def on_draw(self):
        self.menu.draw() #draw the menu
    def on_update(self, events):
        self.menu.update() #update the menu

game = MyGame()
game.run() #Run the finished application

Imperative Approach

import nevu_ui as ui #Import Nevu UI
import pygame

pygame.init()

window = ui.Window((400, 300), title = "My Game") #Create a window

style = ui.Style(borderradius=20, colortheme=ui.ColorThemeLibrary.material3_dark) #Create Style
menu = ui.Menu(window, [100%ui.vw, 100%ui.vh], style=style) #Create a menu
layout = ui.Grid([100%ui.vw, 100%ui.vh], row=3, column=3) #Create a grid layout
layout.add_item(ui.Button(lambda: print("You clicked!"), "BUTTON!", [50%ui.fill, 50%ui.gc], style=style), x = 2, y = 2) #Create a button

menu.layout = layout #Set the menu layout

while True: #Main loop
    events = pygame.event.get() #Get events
    window.update(events) #Update the window
    menu.update() #Update the menu
    menu.draw() #Draw the menu
    pygame.display.update() #Update the screen

Example Result

Example1

Nevu UI Status at the Moment

Layouts (Layout_Type Heirs)

(✅ - done, ❌ - not done, 💾 - deprecated and not working)

  • Grid
  • Row
  • Column
  • ScrollableRow
  • ScrollableColumn
  • ColorPicker
  • 💾 Pages
  • 💾 Gallery_Pages
  • StackColumn
  • StackRow
  • CheckBoxGroup

Widgets (Widget Heirs)

  • Widget
  • Button
  • Label
  • Input
  • EmptyWidget
  • Tooltip (Pygame exclusive, for now)
  • 💾 Gif
  • MusicPlayer (Will be reworked, i guess?)
  • ProgressBar
  • SliderBar
  • ElementSwitcher
  • 💾 FileDialog
  • RectCheckBox

Available Backends

  • Pygame-ce
  • Pygame-ce._sdl2(Sdl)
  • RayLib

Backend Exclusives

  • Ripple effect - Raylib exclusive
  • Transparent colors inside Gradient - Raylib exclusive
  • Customizable center and angle of the gradient - Raylib exclusive
  • Tooltip - Pygame exclusive

License

Nevu UI is protected by the MIT license

Bugs

  • Nevu UI is NOT a stable framework, you may encounter many bugs in it.

Additional Information

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

nevu_ui-0.8.0.post1-cp314-cp314t-win_amd64.whl (3.3 MB view details)

Uploaded CPython 3.14tWindows x86-64

nevu_ui-0.8.0.post1-cp314-cp314t-musllinux_1_2_x86_64.whl (9.6 MB view details)

Uploaded CPython 3.14tmusllinux: musl 1.2+ x86-64

nevu_ui-0.8.0.post1-cp314-cp314t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (8.7 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

nevu_ui-0.8.0.post1-cp314-cp314-win_amd64.whl (3.1 MB view details)

Uploaded CPython 3.14Windows x86-64

nevu_ui-0.8.0.post1-cp314-cp314-musllinux_1_2_x86_64.whl (9.4 MB view details)

Uploaded CPython 3.14musllinux: musl 1.2+ x86-64

nevu_ui-0.8.0.post1-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (8.4 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

nevu_ui-0.8.0.post1-cp313-cp313-win_amd64.whl (3.1 MB view details)

Uploaded CPython 3.13Windows x86-64

nevu_ui-0.8.0.post1-cp313-cp313-musllinux_1_2_x86_64.whl (9.4 MB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

nevu_ui-0.8.0.post1-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (8.4 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

nevu_ui-0.8.0.post1-cp312-cp312-win_amd64.whl (3.1 MB view details)

Uploaded CPython 3.12Windows x86-64

nevu_ui-0.8.0.post1-cp312-cp312-musllinux_1_2_x86_64.whl (9.5 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

nevu_ui-0.8.0.post1-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (8.5 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

File details

Details for the file nevu_ui-0.8.0.post1-cp314-cp314t-win_amd64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.8.0.post1-cp314-cp314t-win_amd64.whl
Algorithm Hash digest
SHA256 e2fc0e8296e7e062217bd3fc3dabef997edaf7516e5db9164539cdf7b4dea4fb
MD5 25934a60bd61622615ca4640b5b72a29
BLAKE2b-256 4c0625b6263c3e177bc121ba36d98b416fac0b649bfc43d8b65f3fd37ad6ac40

See more details on using hashes here.

File details

Details for the file nevu_ui-0.8.0.post1-cp314-cp314t-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.8.0.post1-cp314-cp314t-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 c97afb05fc8585fec6ad53403b4b9e5972494e7e079ba6bc845878dab19f16b9
MD5 715d77e330cedcc4b1e447bba1fc3834
BLAKE2b-256 61edca968924b9c02c2236f9e6da028c13a4b8754a8b5d460653aaf3e3ef644c

See more details on using hashes here.

File details

Details for the file nevu_ui-0.8.0.post1-cp314-cp314t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.8.0.post1-cp314-cp314t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 573fdb762ea0fcdd481fcd5ba69e69f0704b282e4602240d9b9a2475a3a9a497
MD5 410fa38eacff01dcbcf237a50931ab9e
BLAKE2b-256 8067a12633300428029199fe3cc91c764b4633eaa585fe57efece0dcc7f390a7

See more details on using hashes here.

File details

Details for the file nevu_ui-0.8.0.post1-cp314-cp314-win_amd64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.8.0.post1-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 dae73b7ba90ced129f52cb0c9ce3ff897357fa11260b1bc344a9327fba6a5427
MD5 7f56ffe00f41a79a4cc1fbc9feb04f65
BLAKE2b-256 1400d92ade19760500dece925f29e153705405d499f821cd631dbba6bcc69e6a

See more details on using hashes here.

File details

Details for the file nevu_ui-0.8.0.post1-cp314-cp314-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.8.0.post1-cp314-cp314-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 ac8ce7d117cbcc3a9ca049f968850ee93008da08938e6889a782fdba439d55bf
MD5 18a33eac7abf8c2d84fb7790e260a7e4
BLAKE2b-256 7041b280a851919a28db2ea2f4a9e6f66138c38f209d0dbcd612d725111f5236

See more details on using hashes here.

File details

Details for the file nevu_ui-0.8.0.post1-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.8.0.post1-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f640a244004dd77da2a83353fa4c78888fa094c36da7bd94183a73f43c564b52
MD5 d365395c71660c2df67b5c51ebd21902
BLAKE2b-256 0f295964aed8d29086b62b36d1a589b40b73d4f31235f4030f48ecb2a882d851

See more details on using hashes here.

File details

Details for the file nevu_ui-0.8.0.post1-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.8.0.post1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 1d649650514c67f153604433347da04b4b2e50b072631e10578b87736c962be8
MD5 9ff02849533f2ffce0b7d4d3d7f15686
BLAKE2b-256 f753b65b4e9233ef58c1f8c613c4c945121d1ef4ceeb541bfa8950d6a46706df

See more details on using hashes here.

File details

Details for the file nevu_ui-0.8.0.post1-cp313-cp313-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.8.0.post1-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 655e16ce833ca43b218a29ad9101c0d626f25f56f725e2aa17ef005e6cff9b1f
MD5 ccaa2161ac44aee7cafdcf6a38c309ff
BLAKE2b-256 0fe92d65e20a561bdd7eb78f0adf9db7d602d22cf16979d561a239fceb48316b

See more details on using hashes here.

File details

Details for the file nevu_ui-0.8.0.post1-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.8.0.post1-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e5c0b8e1c8411c726395cf429929c8cf672bfb0aee65283004fbfdd17f6e2e54
MD5 5d88a09d56d7fcde1c343d40801596c0
BLAKE2b-256 9c00a68eca4a0cbc7dcec7ffae396c5cc6c5d40f0c0870f38a39c16e68c088de

See more details on using hashes here.

File details

Details for the file nevu_ui-0.8.0.post1-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.8.0.post1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 db9ddb28a501d08e65dc753dc60c7b87386d291ba75b7d8776620523fe0d6216
MD5 efeb8aab7191d771a26ae310a736bed6
BLAKE2b-256 a8cf24b4fe214e24705da9aa3ba4c7e2b5dc156e88a0d69783cbca61ba42b5e1

See more details on using hashes here.

File details

Details for the file nevu_ui-0.8.0.post1-cp312-cp312-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.8.0.post1-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 5e07c2ceb5e6153bf1a925574928223b667b4d3256c52c8b9c5e227e8020aedd
MD5 2124cb70950e94e764bd4e37ccd4dbb4
BLAKE2b-256 5ec40f9ccd37b20e9caab540f932f1058e1c1ba7a9675fb1e7c381742feb6549

See more details on using hashes here.

File details

Details for the file nevu_ui-0.8.0.post1-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.8.0.post1-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3c57f1776afe3a9fc7a81555a926cfcbb3c9082094baa1212c5e41e1e2139993
MD5 7202d077a4adbd1fef7a689729bb0414
BLAKE2b-256 04d511692da81026af5f40ed02f4cd4f772003a20331a1afab15eef9c130f6d1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page