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.7.6-cp314-cp314t-win_amd64.whl (2.4 MB view details)

Uploaded CPython 3.14tWindows x86-64

nevu_ui-0.7.6-cp314-cp314t-musllinux_1_2_x86_64.whl (7.5 MB view details)

Uploaded CPython 3.14tmusllinux: musl 1.2+ x86-64

nevu_ui-0.7.6-cp314-cp314t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (6.5 MB view details)

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

nevu_ui-0.7.6-cp314-cp314-win_amd64.whl (2.3 MB view details)

Uploaded CPython 3.14Windows x86-64

nevu_ui-0.7.6-cp314-cp314-musllinux_1_2_x86_64.whl (7.3 MB view details)

Uploaded CPython 3.14musllinux: musl 1.2+ x86-64

nevu_ui-0.7.6-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (6.3 MB view details)

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

nevu_ui-0.7.6-cp313-cp313-win_amd64.whl (2.2 MB view details)

Uploaded CPython 3.13Windows x86-64

nevu_ui-0.7.6-cp313-cp313-musllinux_1_2_x86_64.whl (7.4 MB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

nevu_ui-0.7.6-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (6.4 MB view details)

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

nevu_ui-0.7.6-cp312-cp312-win_amd64.whl (2.2 MB view details)

Uploaded CPython 3.12Windows x86-64

nevu_ui-0.7.6-cp312-cp312-musllinux_1_2_x86_64.whl (7.4 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

nevu_ui-0.7.6-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (6.4 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.7.6-cp314-cp314t-win_amd64.whl.

File metadata

  • Download URL: nevu_ui-0.7.6-cp314-cp314t-win_amd64.whl
  • Upload date:
  • Size: 2.4 MB
  • Tags: CPython 3.14t, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for nevu_ui-0.7.6-cp314-cp314t-win_amd64.whl
Algorithm Hash digest
SHA256 5992558cc9cd371d89c1303207327314f8e473b33b01b990e7211e4b357ad5d8
MD5 53b78a5aaa1f56ba57b7d9cfa2765d91
BLAKE2b-256 837be582cb2cbc64e8c29ff8b45222e7d0b7cb0637a58987a86cbc45b27f1fc5

See more details on using hashes here.

File details

Details for the file nevu_ui-0.7.6-cp314-cp314t-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.7.6-cp314-cp314t-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 df57efd7e12862e01cc8116924e1ac6ddc0b1330d0053fc5e7dab815ced5e4a5
MD5 89101d53c9f932f210e20e770dabd473
BLAKE2b-256 14f0e4c7c3b61023ea2f2ddb3cfb5bf784e6813278dc8d379b3b307b7b862119

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.7.6-cp314-cp314t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a64d10d216801b173d402abc8123247faec62b5997a3515d100986c258b6012f
MD5 b695c5d0e1f9c0dbc048ce9cf33d2da0
BLAKE2b-256 9ef03a00b9423c9a45880f5e8d31f62444c7a88d4ad0b8aef61aba304bc1104e

See more details on using hashes here.

File details

Details for the file nevu_ui-0.7.6-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: nevu_ui-0.7.6-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 2.3 MB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for nevu_ui-0.7.6-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 4cf4c82e450e20b2cb3579d705f5edbb599d3911ff52f0c97ac84e13ff351001
MD5 e4a4da078afddb894146739b933e8c26
BLAKE2b-256 b37f71f800edcf3c22b459d73679a8c4990c84a4e5ac88fb027570721aea2c17

See more details on using hashes here.

File details

Details for the file nevu_ui-0.7.6-cp314-cp314-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.7.6-cp314-cp314-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 2e1d46aa8c5033ca57a0dd2ae9cea98a11d52ac878e8ad1f8f41fdc5caaf6f3f
MD5 ae710d22105722910103ede7577ae1ad
BLAKE2b-256 55fa2a80189adb0d8d2bc9fab33715b753cca2856536bc9837f0cd0a1e3e4f7d

See more details on using hashes here.

File details

Details for the file nevu_ui-0.7.6-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.7.6-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 fc4fec8bf0f9519999e39e984254f4afc0d41b245d1cb6dae62095aafb649d6a
MD5 325030fba7be5901b7463a284b0572a9
BLAKE2b-256 978f1b6a1388a3301d907914c598d8d46402a2a03c28bb27f30e95ca003ac9f5

See more details on using hashes here.

File details

Details for the file nevu_ui-0.7.6-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: nevu_ui-0.7.6-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 2.2 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for nevu_ui-0.7.6-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 65ab86c778b2dc2cad994bed20583da033f93ee24f165e2cdcd95ce78805c1e7
MD5 e634dff2a000d8c9b1d595ee162b4ee6
BLAKE2b-256 7e7fed63cc70198bc7478273be97f3af8765bd551cec06ff87222b8825f7b40b

See more details on using hashes here.

File details

Details for the file nevu_ui-0.7.6-cp313-cp313-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.7.6-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 91b7e5b0f595b1793042ae489205cb581e99bc79e97c01f219508666b12fc1c7
MD5 ad3546a1140de2066b9e1b02e072049a
BLAKE2b-256 862fb38114ab0ba5f2aa9b5462040f8eaa0576dccc26d612e8dbf5cbc04c0114

See more details on using hashes here.

File details

Details for the file nevu_ui-0.7.6-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.7.6-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 afac7316ba76328d4eb8cec7b2eb60107c83a2d045d157e4c9febc3d100c0ee5
MD5 2557449d8f3475d527d6951a8f539565
BLAKE2b-256 9cd7bbbe774f9f0144ddaf8d9a1148dff04b54fa45f38e4395cd1ce1d943470f

See more details on using hashes here.

File details

Details for the file nevu_ui-0.7.6-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: nevu_ui-0.7.6-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 2.2 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for nevu_ui-0.7.6-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 184e8da0fe91817ff2c52493f02c8f2c0098d66518c930cdb1dea1bd4b24338f
MD5 dfdc910add67d29b91c2a3f38aaea084
BLAKE2b-256 daf180e68c018907e3b15fa154e53417569c542117e5430f50e29eff663d4cca

See more details on using hashes here.

File details

Details for the file nevu_ui-0.7.6-cp312-cp312-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.7.6-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 55a63e905b3ca39161ec30fde9a2a82a06760643108e0834f2adb03692317fee
MD5 627eb9925ef3526bb645ee59852f5e01
BLAKE2b-256 96ce4ff5193b0104e9492ccf156668095b475ecd8d87ace1515cbe377b118d7a

See more details on using hashes here.

File details

Details for the file nevu_ui-0.7.6-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.7.6-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 4ba0b5dd0cf0dbe43514e3c6a7539e941ce3a27181f1d14fc2ff9e1d9be94565
MD5 8119053f12899cbe339e7b1f40515c48
BLAKE2b-256 4d02bbe89bc63c7640a77cc83a540646c611ba4d995ca766e531a996f0084112

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