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:
    • pygame-ce>=2.3.0
    • numpy
    • Pillow
    • pyray

Installation via pip

pip install nevu-ui

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

Uploaded CPython 3.14tWindows x86-64

nevu_ui-0.7.3.post1-cp314-cp314t-musllinux_1_2_x86_64.whl (4.1 MB view details)

Uploaded CPython 3.14tmusllinux: musl 1.2+ x86-64

nevu_ui-0.7.3.post1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (4.1 MB view details)

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

nevu_ui-0.7.3.post1-cp314-cp314-win_amd64.whl (1.5 MB view details)

Uploaded CPython 3.14Windows x86-64

nevu_ui-0.7.3.post1-cp314-cp314-musllinux_1_2_x86_64.whl (3.9 MB view details)

Uploaded CPython 3.14musllinux: musl 1.2+ x86-64

nevu_ui-0.7.3.post1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (3.9 MB view details)

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

nevu_ui-0.7.3.post1-cp313-cp313-win_amd64.whl (1.5 MB view details)

Uploaded CPython 3.13Windows x86-64

nevu_ui-0.7.3.post1-cp313-cp313-musllinux_1_2_x86_64.whl (3.9 MB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

nevu_ui-0.7.3.post1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (3.9 MB view details)

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

nevu_ui-0.7.3.post1-cp312-cp312-win_amd64.whl (1.5 MB view details)

Uploaded CPython 3.12Windows x86-64

nevu_ui-0.7.3.post1-cp312-cp312-musllinux_1_2_x86_64.whl (4.0 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

nevu_ui-0.7.3.post1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (4.0 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.3.post1-cp314-cp314t-win_amd64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.7.3.post1-cp314-cp314t-win_amd64.whl
Algorithm Hash digest
SHA256 5451fa8a08910e7ba5572cfb01130d29e79bd187fb7674a5c4cde320565ecb3a
MD5 9ff1a6eb2300e7fd4aa9775d18fdf0a0
BLAKE2b-256 eccd6642cbb9a97d1dec7f4bfa9f36e5491395dc6037b810bcbd3012aeaee9e7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.7.3.post1-cp314-cp314t-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 de95c433ad28a0280b8987be70523f87ad2e6bf3fe557ca84167defca98c6df3
MD5 a33769d942c0fd552e18fc244140e45f
BLAKE2b-256 e8f099da7cad0f3a6939c97f0670201bc49c85c03e5da3903717c298b52fc3b6

See more details on using hashes here.

File details

Details for the file nevu_ui-0.7.3.post1-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.3.post1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3d2b055cb9ccf18410d8327c45b13da0c79c292b390b5559d1aa6f1dc98f4474
MD5 f3d41ed2ec0a4f3264831d6ee6409a41
BLAKE2b-256 8712c60f13e497f3a91f10f1719affc89496efc06979e99477d6de19dce38df5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.7.3.post1-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 515edcd5e5682ae71ad55183ea21acb49f2e210d4508a1f0b3a5cc69031c41bf
MD5 39d649ac57aa4be5b5579b92f7889882
BLAKE2b-256 4d942da0f3dbd57fb31a34df62a66d339df6ca89c184fcf2cfaddf2f4c8719d8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.7.3.post1-cp314-cp314-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 5c0c965e6769d3374fbac5c8eeafa5c705552f011af1617170e52cdd789cde8b
MD5 4e2e06fe80e480f7e18883c8b4ce8fa0
BLAKE2b-256 eccaaabaa96835928864dd198b1ca225935e293f15ba5ba860bf68cac3294ba0

See more details on using hashes here.

File details

Details for the file nevu_ui-0.7.3.post1-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.3.post1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 64dacb857b046d07f3d55187a9163ad2ac421df10ca2e866248d07705e4c567b
MD5 b6508f1ded29c3200ec3776c09c3a1db
BLAKE2b-256 df1f5c871fe6bb778b53244379557c17a8883528c6b5167d1a35b6d245bb469b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.7.3.post1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 955767201ebf5c4e114466bf15bf162ecdd29f004bc226dabf51972ab44bc29d
MD5 e243032a334209d34149d194ffe9c1c9
BLAKE2b-256 4aa790bf4774fb791a5f4251e5360f0cac76c9f392d819b07c9c95d581059866

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.7.3.post1-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 220a2478e981bc8a3c4a783382811018f462a0d3cb73ee27864150d94d4d5853
MD5 88f8c7504c78dedc85763e1b929b0ac3
BLAKE2b-256 a2f0221fca1c95bd1f83e55129ac7468860df3893cdbf9e56993325c6813edef

See more details on using hashes here.

File details

Details for the file nevu_ui-0.7.3.post1-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.3.post1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 12afe390fe53955b859c8cc14a01157e678fc7aa96f5d395a9edf2cd60b7060c
MD5 44fcddc973ee2a0abb51f2c063b42e29
BLAKE2b-256 281cefa43622f6a736c1857f2cc23cdc2885923379ae4d1e2817fe8a98faa0f9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.7.3.post1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 309f8abfe85eef9eb7de378b148e11848b47c44096b15910168fe0923dbaf03f
MD5 b19f37f6400244cfc63d47871bd11083
BLAKE2b-256 134bb52d6a1248e26114751aa27124e22c567b53a3fc87846f64a4e052b70ab2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.7.3.post1-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 07853c05f411c3f954759ee3b2bb68ba03c7f98f3924e9f33211fb16306ac8d7
MD5 b53c8d456aa3cbe4d37b16b071b9654b
BLAKE2b-256 2bda8d19fd54663b822fba2bb3d4f2bf1061ada3d92f9dba4c4020f1e6bba66e

See more details on using hashes here.

File details

Details for the file nevu_ui-0.7.3.post1-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.3.post1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7e673dd4624a78ab18ee6b996d1145842b70b706247fe68a189806bb7693c8e2
MD5 828e2708bcc34ffc604ba1bbaf22399d
BLAKE2b-256 9f2fa2370a1396f4d458e903347dd1ce0127417f1e9a9f4476ed858e02327987

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