Metadata-Version: 2.4
Name: menuet
Version: 1.4.0
Summary: Declarative menu builder for DCC applications
Project-URL: Changelog, https://gitlab.com/tahv/menuet/-/blob/main/CHANGELOG.md
Project-URL: Documentation, https://tahv.gitlab.io/menuet
Project-URL: Source, https://gitlab.com/tahv/menuet
Author: Thibaud Gambier
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: attrs>=26.1.0
Requires-Dist: tomli>=2.3.0; python_version < '3.11'
Requires-Dist: typing-extensions>=4.15.0
Provides-Extra: copy
Requires-Dist: copykitten>=2.0.0; extra == 'copy'
Provides-Extra: qt
Requires-Dist: pyside6>=6.11.0; extra == 'qt'
Description-Content-Type: text/markdown

# menuet

[![Source](https://img.shields.io/badge/source-%23fc6d25?logo=gitlab&logoColor=white)](https://gitlab.com/tahv/menuet)
[![Documentation](https://img.shields.io/badge/documentation-teal?logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzNiIgaGVpZ2h0PSIzNiIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiNmZmZmZmYiIHN0cm9rZS13aWR0aD0iMi41IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxwYXRoIGQ9Ik0xMiA3djE0Ii8%2BPHBhdGggZD0iTTMgMThhMSAxIDAgMCAxLTEtMVY0YTEgMSAwIDAgMSAxLTFoNWE0IDQgMCAwIDEgNCA0IDQgNCAwIDAgMSA0LTRoNWExIDEgMCAwIDEgMSAxdjEzYTEgMSAwIDAgMS0xIDFoLTZhMyAzIDAgMCAwLTMgMyAzIDMgMCAwIDAtMy0zeiIvPjwvc3ZnPg%3D%3D)](https://tahv.gitlab.io/menuet)
[![PyPI](https://img.shields.io/pypi/v/menuet?logo=python&logoColor=white&label=)](https://pypi.org/project/menuet)

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

## Features

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

## Project Information

- [**Documentation**](https://tahv.gitlab.io/menuet)
- [**PyPI**](https://pypi.org/project/menuet/)
- [**Source Code**](https://gitlab.com/tahv/menuet)
- [**Changelog**](https://gitlab.com/tahv/menuet/-/blob/main/CHANGELOG.md)
- [**Contributing**](https://gitlab.com/tahv/menuet/-/blob/main/CONTRIBUTING.md)
- [**GitHub Mirror**](https://github.com/tahv/menuet)

## Installation

```console
pip install menuet
```

## Usage

Create a menu configuration in [TOML](https://toml.io/) format.

```toml
# menu.toml
[[action]]
id = "print-hello"
label = "Print Hello"
cb = "print('Hello')"
group = "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.

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

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

builder = TextMenuBuilder(model, root_menu="Demo", render=Render.UTF8)
print(builder.build())
```

```text
Demo
├── Foo
│   └── Bar
│       └── Open GUI
├── Separator ───
└── Print Hello
```

For more information and examples,
visit the documentation at
[tahv.gitlab.io/menuet](https://tahv.gitlab.io/menuet).

## Contributing

Contributions of any kind are welcome.
Please [open an issue](https://gitlab.com/tahv/menuet/-/issues), or read the
[contribution guidelines](https://gitlab.com/tahv/menuet/-/blob/main/CONTRIBUTING.md)
and open a [merge request](https://gitlab.com/tahv/menuet/-/merge_requests).

## Alternatives

- [hannesdelbeke/unimenu](https://github.com/hannesdelbeke/unimenu)

<!--

## Roadmap

- [ ] Tests: menuet.builders.maya.MayaMenuBuilder
- [ ] Tests: menuet.builders.unreal.UnrealMenuBuilder
- [ ] Tests: menuet.builders.max.MaxDynamicMenuBuilder
- [ ] Builder: maya.cmds.popupMenu (marking menu)
- [ ] Builder: 3ds Max MenuMan System
- [ ] Helper function to get QMainWindow or QMenuBar
- [ ] Icon path should be relative to file

-->

---

<a href="https://www.buymeacoffee.com/tgambier"><img alt="Buy Me a Coffee" style="height: 50px;" height="50" src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png"></a>
