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

Uploaded CPython 3.14tWindows x86-64

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

Uploaded CPython 3.14Windows x86-64

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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.12Windows x86-64

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

File metadata

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

File hashes

Hashes for nevu_ui-0.7.3-cp314-cp314t-win_amd64.whl
Algorithm Hash digest
SHA256 8a517c56410f0dac53b957241e5ac14e8974d2a2c6c0fdf4065bd6d5253d5dd4
MD5 885140a8b52e89f4c9c22826987ba028
BLAKE2b-256 25f62cc12ae08fa0b30e63f33e7c6f1da835edf37de81ef0d513510c719b249e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.7.3-cp314-cp314t-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 adb64856d870f1808f2c112f4e3b4ac6be632757481b60b8ca9465a677ad0a27
MD5 742071a320c9874bf3f315c4da23011c
BLAKE2b-256 b38eb8351664fd3bf4868e579c25aaff32b059d06081141d3770427387f24081

See more details on using hashes here.

File details

Details for the file nevu_ui-0.7.3-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-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9545a63917a3e419b7a327fec40c464dcfa45a356ed344c5dd44b40765167a80
MD5 3d7a029ee3ad9b47908c7ad85a36c0e4
BLAKE2b-256 2cd1d336a2f7caa6983742706826a29bb35665aa9ef6d1e131c6507d652d3f8e

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for nevu_ui-0.7.3-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 d5c252421f03fce91edfdac0f65c1983c00eab5a5d6ee789c023e50c8e3e05b8
MD5 a9380b1291fc27b3aaf65597f3384d13
BLAKE2b-256 2defbfd7d875e0472d9b6b810e2ed193e4d2a1185b44ed17e9cfe954104f59bd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.7.3-cp314-cp314-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 965130c22adc7fd740649bf50826b346b01be8e98e235de9e758e8d77f832a43
MD5 10a9741772c13e2904d5f53feead27a4
BLAKE2b-256 650074d221b5c1b2265c1b4649dcc4c583a3ba4b066560c45e9ed2896ea33ebb

See more details on using hashes here.

File details

Details for the file nevu_ui-0.7.3-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-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 89f36753ab5998bfdb7475907c43b06edfaee378704c16c90fad849bf5720337
MD5 672687de390729f61598dd06c4a2828a
BLAKE2b-256 c424f1d27da9cd4af1de5b75890b126b023c3e97aa3feeaf65ff2c2bde60c7bd

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for nevu_ui-0.7.3-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 b96426a9a3d8a258d68b137c79b73988c5284b597ef4735a4b2f690a945ccd7c
MD5 03c048958205f5173c511e8b9b66514f
BLAKE2b-256 6cb01a5021933466bf30eb87cb9d59106bf0f1235c35abbfd74d725f696464c0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.7.3-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 9bb736920fa1dc71570972c05cff3eea00af799c783daed9ef39b625f73cfff8
MD5 4886880c62224830a58671bde375c7e3
BLAKE2b-256 4ea955165a7f536be4e8c51674e1403510f783a03986ed15af17a57572440cd6

See more details on using hashes here.

File details

Details for the file nevu_ui-0.7.3-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-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a6a0807f9c11294045241395aba93f9a74545569b246913a4fd4921154561567
MD5 43f994ec7ca03261c200036924f3bc1e
BLAKE2b-256 b228c434fcbfd30fafb6f619d5bffabba32dd1e601e03ec7809ef3bc22912d26

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for nevu_ui-0.7.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 02c739b05ce982dbd1ede4b0daec21a6b1776c4a93a1532bfcb4e00494581862
MD5 dfdc9897acd2758339ec52d85eb4e01d
BLAKE2b-256 f7188f9162c22f8a70562905e55900ab8f0052ba781605790273adcb9695e639

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.7.3-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 5ee3db50bf6fe7acab43c2beeb09d829abf9cb0c3404b5e83da79f3185340b4f
MD5 d46b9194e61b0545f4b8909568c24636
BLAKE2b-256 b89577a65e2dc4936bb3a6904315a4cbfa200ca14b1e054b9b54d2727d924114

See more details on using hashes here.

File details

Details for the file nevu_ui-0.7.3-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-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e4c93d99044848714387df548bccce14df33fc22cbf06d16d65459f16893ad99
MD5 0a7e804854d3b02eaaa74f3105591da3
BLAKE2b-256 b753f3f42a16cc0d9429c0c3276a5280f53f98658c6f1e57c0d617fd23cfac66

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