Metadata-Version: 2.4
Name: menuet
Version: 1.0.0
Summary: Declarative menu builder for DCC applications
Project-URL: Repository, https://codeberg.org/tahv/menuet
Author: Thibaud Gambier
License-Expression: MIT
License-File: LICENSE
Classifier: Programming Language :: Python :: 3
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/Codeberg-%232185D0?logo=codeberg&logoColor=white)](https://codeberg.org/tahv/menuet)
[![Documentation](https://img.shields.io/badge/Documentation-teal)](https://tahv.codeberg.page/menuet/)

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

```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 = "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.

```python
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())
```

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

See the [documentation](https://tahv.codeberg.page/menuet/)
for more advanced patterns.

## Contributing

For guidance on setting up a development environment and contributing, see
[CONTRIBUTING.md](https://codeberg.org/tahv/menuet/src/branch/main/CONTRIBUTING.md).
