Skip to main content

A powerful GUI framework for Python that allows you to create declarative interfaces with ease.

Project description

Example1

alt text

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 even 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.
    • Inheritance: Styles can be created based on existing ones.
    • 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, **constant_kwargs: Unpack[MyWidgetKwargs]):
            super().__init__(size, style, **constant_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/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, hopefully)
  • ProgressBar
  • SliderBar
  • ElementSwitcher
  • 💾 FileDialog
  • RectCheckBox

Available Backends

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

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

Uploaded CPython 3.14tWindows x86-64

nevu_ui-0.7.5-cp314-cp314t-musllinux_1_2_x86_64.whl (4.6 MB view details)

Uploaded CPython 3.14tmusllinux: musl 1.2+ x86-64

nevu_ui-0.7.5-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (4.6 MB view details)

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

nevu_ui-0.7.5-cp314-cp314-win_amd64.whl (1.7 MB view details)

Uploaded CPython 3.14Windows x86-64

nevu_ui-0.7.5-cp314-cp314-musllinux_1_2_x86_64.whl (4.4 MB view details)

Uploaded CPython 3.14musllinux: musl 1.2+ x86-64

nevu_ui-0.7.5-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (4.4 MB view details)

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

nevu_ui-0.7.5-cp313-cp313-win_amd64.whl (1.6 MB view details)

Uploaded CPython 3.13Windows x86-64

nevu_ui-0.7.5-cp313-cp313-musllinux_1_2_x86_64.whl (4.4 MB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

nevu_ui-0.7.5-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (4.4 MB view details)

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

nevu_ui-0.7.5-cp312-cp312-win_amd64.whl (1.7 MB view details)

Uploaded CPython 3.12Windows x86-64

nevu_ui-0.7.5-cp312-cp312-musllinux_1_2_x86_64.whl (4.5 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

nevu_ui-0.7.5-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (4.5 MB view details)

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

File details

Details for the file nevu_ui-0.7.5-cp314-cp314t-win_amd64.whl.

File metadata

  • Download URL: nevu_ui-0.7.5-cp314-cp314t-win_amd64.whl
  • Upload date:
  • Size: 1.7 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.5-cp314-cp314t-win_amd64.whl
Algorithm Hash digest
SHA256 a610d21e643e92c1adc67c3321227cb71be1b2b7f4820cc42e92170dd95dac21
MD5 4eee0785a36b3889e4945740f08bf146
BLAKE2b-256 85f9a0435cd1c44c978d2b000e187be72c9bf8fdcc9dd7ddc526650368507999

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.7.5-cp314-cp314t-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 e7fb78292813cd8f153fbfbf8ac68e6b42f1c93f79d54e08692c6a525dd482e7
MD5 065d075f886b9c3c2fe0ed9bb315e95d
BLAKE2b-256 6c7b3596d6f2580576defe554f939228e61a1ea6bdc877e544fe9798873d8974

See more details on using hashes here.

File details

Details for the file nevu_ui-0.7.5-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.7.5-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1c89014609cff8bd385c1c1177ef4ff510b53721e3a5fdefd12f788940802e87
MD5 3ff075bd8dac437f2e9a524870d66ebf
BLAKE2b-256 6e1917de9eb324c07a2a320ad697e28f2bbbe32c864348a084bf64cfcce9347a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nevu_ui-0.7.5-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 1.7 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.5-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 e401daae2af0e8af7e3e4a655c48708e97291c7a61c6a61b4256a097c56d5a2e
MD5 fa5f5e7b76c890a3bc66e6cfe425a357
BLAKE2b-256 220291ad90e429f9e8240a3a0993b50feb75bbc2b994b6a53c4746461dc30bc3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.7.5-cp314-cp314-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 c4baf652b37522dc6d33cab9c19d79bc24c619ef39b711211c1d69ad5deb0f1c
MD5 c7c1f555a91541f772d548e0950c020b
BLAKE2b-256 e2ef4f2ba43a9fe433c589854436d452a80552649d84d913a3a49dd1c8484c3a

See more details on using hashes here.

File details

Details for the file nevu_ui-0.7.5-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.7.5-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a77729983422c0cf8a409eec842a507b483d6c2860d79124a27848702b62a6a2
MD5 98ad98ce9b341dc57558d3f127b866ca
BLAKE2b-256 bb395b106e55c568c49a7b81ada6f651da4dfaf9cd55510351b25f4795d98913

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nevu_ui-0.7.5-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 1.6 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.5-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 1e4d5a44df7d472b42155446c0a80e6d6f011945dcec9f7011fa57efc604a55a
MD5 9d40b39bcdf3fa8cfa4694819e110ccd
BLAKE2b-256 242647bfc0d3c48a3c2b6d460ae8b0aeea6c7cd2a8d0413b213465356e54239d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.7.5-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 14c0c00ac4683dcef0c60b96c7f690095396023cb50d83abea90ad0db08420eb
MD5 c6f78bce6a666c39ddf2dd0b5142504d
BLAKE2b-256 a5ed63939dff91f33be35e5267067549a26dc17168a15d0ba882338d336994a9

See more details on using hashes here.

File details

Details for the file nevu_ui-0.7.5-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.7.5-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 87ce0893cfe5943131e8356d6d4fed1f43a8c8928586d9faee992b9b826051ac
MD5 174eb6e3dea91f13616f0fb67c6fd4b2
BLAKE2b-256 a44800c960441ca45863a564bf3e2635a916bb93dc1eca579438cb1e500458c3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nevu_ui-0.7.5-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 1.7 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.5-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 fd076211821686248a5ee8027f38fb90665c49503a06bc188cf722f0e7c9335b
MD5 0681ef50dcef0fbd916a6ac3335beb5d
BLAKE2b-256 577b76b222361d8c9ce9be9f29b95a69bb50903e216a357e4516801a1a5c16c6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.7.5-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 be58ddaf36a14e2c1ef5976da3f92df771b91639ce1b0f54bbcdeb8d1a367a0a
MD5 61339fe9531de2a047c7b1ce25c8633b
BLAKE2b-256 83e7839a1ea36a89837da10cf9100e4f0b230a3289759d21d5818b09f3d20733

See more details on using hashes here.

File details

Details for the file nevu_ui-0.7.5-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.7.5-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ba12a7ce57c16abfccf278765bcbf72f3e044116c8d3286a8d50b1e4cd1b99c2
MD5 17dbbb006cc55683545ddf14d6db5498
BLAKE2b-256 c09a5f257e70975b2ee505cc8c0c2ecc276af0b678afcf6da6900da0f477ecf8

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