Skip to main content

Declarative menu builder for DCC applications

Project description

menuet

Source Documentation

Menuet (/mə.nɥɛ/) is a declarative menu builder for DCC applications.

Features

  • Supports, 3ds Max, Maya, MotionBuilder and other any PySide6 application.
  • Load menu from a TOML or JSON configuration, from a dict, from entry points, or build it programmatically.
  • Declare one or more menus in a dedicated .toml file.
  • Compose menu from multiple .toml files.
  • Declare a menu in a pyproject.toml directly.

Installation

pip install menuet

Usage

Create a menu configuration in TOML format.

# menu.toml
[[action]]
id = "print-hello"
label = "Print Hello"
cb = "print('Hello')"
group = "Some Separator"

[[action]]
id = "open-gui"
label = "Open GUI"
cb = "ep:myapp.gui:open_gui"
menu = ["Foo", "Bar"]

Load the above configuration into a Model and pass that model to a Menu Builder to create a menu.

from pathlib import Path
from menuet.builders.text import Render, TextMenuBuilder
from menuet.model import Model, loads

model = Model()
loads(Path("menu.toml").read_text(), model)

builder = TextMenuBuilder(model, root_menu="Demo", render=Render.UTF8)
print(builder.build())
Demo
├── Foo
│   └── Bar
│       └── Open GUI
├── Some Separator ───
└── Print Hello

See the documentation for more advanced patterns.

Contributing

For guidance on setting up a development environment and contributing, see CONTRIBUTING.md.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

menuet-1.0.0.tar.gz (79.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

menuet-1.0.0-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

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