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

Uploaded CPython 3.14tWindows x86-64

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

Uploaded CPython 3.14Windows x86-64

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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.12Windows x86-64

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

File metadata

  • Download URL: nevu_ui-0.8.0-cp314-cp314t-win_amd64.whl
  • Upload date:
  • Size: 3.3 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.8.0-cp314-cp314t-win_amd64.whl
Algorithm Hash digest
SHA256 b1f714172122ef97ba65a4343f76e81a438d2277e484ad395b62916e5a8e664d
MD5 dfdbe8496fcfc8f4a762e696c1234a30
BLAKE2b-256 362c81fb5683b1ee593aa7f4cecc35029b6c25163e2a76f6718effc06351c730

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.8.0-cp314-cp314t-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 2b80e2e374b5bdc7b171afa00b89d0cec383a9480ece127e674a82b0ef0f53e4
MD5 94f67712b2fadd1771bd2aa4c0c10ab1
BLAKE2b-256 760f1f6901539e0dcd1a38a7020db0b0c60649cdecb315dc89a37b8df2d1f314

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.8.0-cp314-cp314t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 837757bbc3bf44461e24b385701491273139a8c782f619405128213728a230f9
MD5 6bd76553bdaa1e30dc33b0afcfd7ea61
BLAKE2b-256 e3025d08bd6ce48a1af2b4e514e636693158d4f5dd2c21887a1af8165b627d48

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nevu_ui-0.8.0-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 3.1 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.8.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 67950b14b5e1007528b072b18dbe2fd648cf1cf3ab9c1ec7bd4f99e7ffc50e5b
MD5 9443be34069cd95cdb197a98ebc4ae1e
BLAKE2b-256 5649dc79ff203c1c8e6d2e3cb42d2aedcc9f8ab1e6b4d25bb4d50d141329777b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.8.0-cp314-cp314-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 6ede1ba5f7237b8458c301197396af00af5add958188d9ab0bb1b8b8ea41aea1
MD5 efc2102e3d07c3c26334bc27512c528b
BLAKE2b-256 a33c9085ba2f4b008ec87f9f46cdfdbff400038541dcd0ca22b7b780ecb72c6e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.8.0-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 bd4c2ed103cfe3835160badd5ce9870bfb126d2f96220670e9f83a5274130e77
MD5 37e5edc188f9ab3cff191cdba194699c
BLAKE2b-256 bddc5fa1f18c290ffb7694083b64ef8ad58788d4a8260c16562614393bf14fc4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nevu_ui-0.8.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 3.1 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.8.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 8bd9d042d8ad38f076e49f81ef70666352d58899081700b202c8e83e9429b69f
MD5 f7494125854c5872ec908b2e78c95f54
BLAKE2b-256 5d13b9d3e264cb3213063f01ca89f09f30f54ca0b48cd4a6ecc88f23a18e61a8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.8.0-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 d13af726c18ec39fe26dd88c3549ff0b2fdb841294b4f92eced3ca145eeac987
MD5 e8721b3bb1cb7ccd903e0954e8dced20
BLAKE2b-256 2368653c5b536eb8e0fa88cb707803cc8a817b7877a647e9693b9ff807e90e3d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.8.0-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f75b807f4c3a7b710fe79f290f2417a7e76265a5db0a4d74dc064ea6b0023ae9
MD5 070511363541db627330d4fe844b57e8
BLAKE2b-256 574b53cc8ce2aa110d75a373965f4d0f0cf7359efe6de59db5dc12f28b3dc092

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nevu_ui-0.8.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 3.1 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.8.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 8a1bf1bbfec2fe0bb85f72a9463f2618f9244ea6c0bd7e1e47a42a8398053fc2
MD5 4322049506adb77363d54242f5a9524a
BLAKE2b-256 1ecb5f3e7a2743e80ec417ffeb344f3e36a694224bd5ac0aba9e3414dd8185b6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.8.0-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 585d8ae9d8259462129a788cc63d2a29cbebef99bbdc259444abb01150160dfa
MD5 3c34654a928b842d8270ae269528641c
BLAKE2b-256 2440c050cf982c5db752385b0ff852c674684b232d6128671aac6ae1ef919e55

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.8.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0e93885437b4ed0f7e723718951f514098f1adae7ac2d37ef8e03a8dd5798fe0
MD5 d9a004197876c258c28999f00fff3322
BLAKE2b-256 64578837d25d5d1a363b3b3992d60e6e4e3598626cad113bd7bfd43b900879ef

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