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

Uploaded CPython 3.14tWindows x86-64

nevu_ui-0.8.0.post2-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.post2-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.post2-cp314-cp314-win_amd64.whl (3.1 MB view details)

Uploaded CPython 3.14Windows x86-64

nevu_ui-0.8.0.post2-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.post2-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.post2-cp313-cp313-win_amd64.whl (3.1 MB view details)

Uploaded CPython 3.13Windows x86-64

nevu_ui-0.8.0.post2-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.post2-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.post2-cp312-cp312-win_amd64.whl (3.1 MB view details)

Uploaded CPython 3.12Windows x86-64

nevu_ui-0.8.0.post2-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.post2-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.post2-cp314-cp314t-win_amd64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.8.0.post2-cp314-cp314t-win_amd64.whl
Algorithm Hash digest
SHA256 bc8f5a2731e94cc073029f84474631d0606b241a1bc7e95a30e0104abf118977
MD5 464b434e35f5897d94d81d6b70de7b5b
BLAKE2b-256 28efe05aade91f939c1f442a242078e2ffe6f4124c2f016e42630eeaa5769f30

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.8.0.post2-cp314-cp314t-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 316838188c5b43d3a5c26713f3b205493f650e1b9e9ea7770cb7a2cb5f1b82b3
MD5 fe04fff1fdc27c9333fb71a4c930cb85
BLAKE2b-256 9c7e0544017094d8adac851b46022e727f12ccaadb975adf9d0492bc62a9cca7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.8.0.post2-cp314-cp314t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0e034713121820480a7540515a49068bd5f488e41214226bf605eece521606fd
MD5 477b5a729eca6601a41f79739bddb582
BLAKE2b-256 29cd0978a1edc65f505b1bb847e7f25d9c76dd5eab051e71f7486c9b45964f49

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.8.0.post2-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 0b8e4b7babd74c0068b74e80f0b4c2000bbf92deee278c1fba101e46913f4708
MD5 16ed50c62d5a15ec1d6932f3d7b44f1a
BLAKE2b-256 d33b070384f4ab9d69e4d88421d7ee0f39ef0cb6c1a708c8dad58c3ef10a4008

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.8.0.post2-cp314-cp314-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 f01854c701124a27633cfd818feba532bb53c335094476491754686553ace414
MD5 68c4f3867a39c6ec6a774705ab354601
BLAKE2b-256 044700e08335d20fb10e20cf4c4f0afd17808cdd7fc3dfe2b4eb7b6eca8604c6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.8.0.post2-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b4a436c4ec76168853ba712e29ddfba072683d96652d66e0fd196046dd5ac29c
MD5 49ec21fa1d4aaad667149aaa50bf0bbc
BLAKE2b-256 2c620d4a9af330d91bd781a156eed2058d2deb80a1edb8035602cdcb82ad7487

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.8.0.post2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 969ab78e9113a05fc045b6dc952d88007084300b24f22391f0dd0c044aae3789
MD5 4e0631fc25d317716aaf4c493766810d
BLAKE2b-256 48b78a6237cdb38b19ba27e44c31cf4f8701cbb8d3eea3ffb9686790be5b90a5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.8.0.post2-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 123dc191f3072b8b8dfc276822cd41c1aff9e0a76f8650fbcc42228d63cdb214
MD5 c6ab257d8185eed12171fddc5913c313
BLAKE2b-256 89a0bc780ae08f0c25fbb0ddafd2dfde90d63b8b6f327dd56147b209d3a2ac87

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.8.0.post2-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b092c46b064bc3807e8401fa5b4cc4de5c56c0bf1939957d0cec4365d6c7dca7
MD5 204e5e5aed71eb1287a38349996be743
BLAKE2b-256 0f1f2c104b9d09066374503f08ccb7e5a8659978384b467c7f3e3c9ff769aa05

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.8.0.post2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 72a42d54f6796d02ac48566c53706a719d5052949314a38f28570d7dbf6b6358
MD5 64ca2c02e9800117bd0ba099371931e1
BLAKE2b-256 414858dc141c83b0bf5151efbe1c74a3fdd67598d85c55781db2213d800d0fb3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.8.0.post2-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 cb3334942f8dc302c5d7a462bea7da55ecad09a56ccff23f9b9bd48e7ba5c9bd
MD5 fdeaa6a1f20b5bf5059b03bb3ba81af0
BLAKE2b-256 1c7b1bc1735b84b1c4ef6bf4aff75ffb3d2021215bfa0437224ec1bfeadc1398

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.8.0.post2-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3955dde8caeb0a2866039d1eccb73767f7ca5526f9998c141fedfd08b80002ce
MD5 71aaacd917b305e478cf7cd680389835
BLAKE2b-256 732ebbbfd5c7430d03cf5b97f0faab79fca3a9e870557a8d277eb4bfb65280e9

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