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

Uploaded CPython 3.14tWindows x86-64

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

Uploaded CPython 3.14Windows x86-64

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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.12Windows x86-64

nevu_ui-0.7.4.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.4.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.4.post1-cp314-cp314t-win_amd64.whl.

File metadata

File hashes

Hashes for nevu_ui-0.7.4.post1-cp314-cp314t-win_amd64.whl
Algorithm Hash digest
SHA256 46a8b50d5627633f17e6d59d4631ee58c3dbd6a5be7bbd8912e21a10fc3506aa
MD5 606ef69ed15ce1252ae8842bff49dda4
BLAKE2b-256 c016035f9fcc40867b06214273708fd022dc9e7116e383882c2462f6ae2655a3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.7.4.post1-cp314-cp314t-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 07b35f0b6ede196e17222a00a7e1861f83ab1292fffb23da0768d8f376608aa5
MD5 05e83d9296df2a284a605d33b3087db0
BLAKE2b-256 4a78eeee2ca1b186514061b1b3f5bf93cae50f90acef0cba8d0a567a91039a03

See more details on using hashes here.

File details

Details for the file nevu_ui-0.7.4.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.4.post1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1a311b5f89f629e17063d1e78dffb2d187e69529e48623214f0c90d14c496d36
MD5 36109943c0f55cdea8b069c5dcee31ac
BLAKE2b-256 dfbb16e3c3774d8e975cdc0ee690a2b238e5b52fe55b54e50b358093d06c3c51

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.7.4.post1-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 d8ae11da96c58c51e996b27b7962ffe3ce7045ed10f0c52d75eb2d24b73e29e7
MD5 acb89d3181dbfb129ff85ed4bc0570ae
BLAKE2b-256 17cfff9f36254ca75bb6cb384df57186a3754b3e7d8d24925fc3679c66f204eb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.7.4.post1-cp314-cp314-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 9be37fee947fc2ead151141e6aa9621bc63f5424b4cbd3004318123487d0e4df
MD5 3669dfd1e5fbe32b8515c3cd1141a943
BLAKE2b-256 58d889f860a67a2598fd412ebbd5775c5ea1723f9a70364525e66aaaede1dd0e

See more details on using hashes here.

File details

Details for the file nevu_ui-0.7.4.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.4.post1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 cf3dcd86f77589f6e7d4f05a427f249960692681885a10a8ebb720761c6b39bb
MD5 b60e0cd2bb14b77c53c831157679ea60
BLAKE2b-256 5cd2ad72510735ef353d66f44603fd2c77a0ab724ab83ac342aa99c25b3aa546

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.7.4.post1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 9d29c4765314d0a2d495b4272c0c9df47f01ddc834d88b21ac86048ecfd88e00
MD5 4ed947d69dbb63151832e2ef95b606cb
BLAKE2b-256 829740ef13bd8098cbd651f59d3d15837a7a8bcbbadaac7a161eef2ed6c4deff

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.7.4.post1-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 01460a042e48d6c3b318f1dd60c3a45a4aae9eae5d6defd176273f02c8e9d5d2
MD5 60178763f4fef2960a0b01967bc791c6
BLAKE2b-256 40c366537c8362d1b6cb1d34192a261cbd359b757ba615f7cf8dee8dc1aac92f

See more details on using hashes here.

File details

Details for the file nevu_ui-0.7.4.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.4.post1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0df5effbca90b6f9ae99b2699aa34b745c33ca78a6ff9811838eb12e7a51a534
MD5 8826d2e53feaf049d7e5fb11d067f6cc
BLAKE2b-256 eba3dfa1e58d098c79c2497918e3bbf09a05638704e3409fc09af4fe1e1ece67

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.7.4.post1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 6e55870c8be99e70c945e9d9d5ebc6e3f3edee0aa1c88e83b0616aafca8b5ea9
MD5 6abdc03cc8de7346d1b8eb11a468273e
BLAKE2b-256 33ebc8775fc6b565beab848278130f5a2211f2ec23fec26954ab07fb9034185d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nevu_ui-0.7.4.post1-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 c5ca7d0fc54b43a9a12003060309f2bc0b0d18ef9ef1e24905aa1aea58dddbc0
MD5 e345a84be8fd7d4311d9e3c66bc3079e
BLAKE2b-256 dd4d004a3b02dd1e0eef34ffc8ce17f6edeb33776aa5fa5e15400d8fbc4ec5be

See more details on using hashes here.

File details

Details for the file nevu_ui-0.7.4.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.4.post1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 80eda1a16ec86b513b93347ca056a716d9a6d3615b6c8db58e616e3d0b5f0d19
MD5 6a04f35383c9927f178bb11a1233ede1
BLAKE2b-256 0282004eee20ec1fbbaf4d7e0c0bd3415781e72b06dc14565eb7b577b2c8b9ae

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