Metadata-Version: 2.4
Name: pydez
Version: 0.2.0
Summary: Python bindings for Dezrann
Home-page: https://gitlab.com/algomus.fr/dezrann/pydez
Author: Mathieu Giraud
Author-email: Mathieu Giraud <mathieu@algomus.fr>
License: LGPL-3.0-or-later
Project-URL: Homepage, https://gitlab.com/algomus.fr/dezrann/pydez
Project-URL: Documentation, https://gitlab.com/algomus.fr/dezrann/pydez#readme
Project-URL: Repository, https://gitlab.com/algomus.fr/dezrann/pydez.git
Project-URL: Issues, https://gitlab.com/algomus.fr/dezrann/pydez/issues
Keywords: dezrann,music,annotation,analysis,corpus
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Artistic Software
Classifier: Topic :: Multimedia :: Sound/Audio
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: Flask>=2.0
Dynamic: author
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-python


# pydez: Python bindings for Dezrann

[Dezrann](https://dezrann.net) is an open platform to hear, study, and annotate music on the web.
Pydez is a simple, spec-compliant Python library for working with Dezrann file formats:
- `.dez` files (Analysis and Label data), as defined in [Encoding music annotations](https://doc.dezrann.net/dez-format)
- `.json` files (Corpus, Piece, Source, and Metadata),
as defined in [Specifying corpus and piece (meta)data](https://doc.dezrann.net/metadata)

## Features

- **Label**: Individual annotation with `start`, `duration`, `tag`, `type`, `comment`, and custom attributes
- **Analysis**: Collection of Labels with metadata and layout rules
- **Source**: Base class with subclasses for different source types
- **Piece**: Musical piece with opus metadata and multiple sources

All classes support:
- `dump()` → Convert to dict
- `load(filepath)` → Load from JSON file
- `save(filepath)` → Save to JSON file
- `build(dict)` → Create from dict with error handling
- `+=` operator for combining instances

## Installation

```sh
pip install pydez

# or, for development
git clone https://gitlab.com/algomus.fr/dezrann/pydez.git
cd pydez
pip install -e .
```

## Example usage

Working with analyses, pieces, and corpora

```sh
cd examples
python generate-analysis.py
python generate-piece.py
python load_modify.py
python generate-corpus.py
```

Creating a service handling music data, as described in [External services](https://doc.dezrann.net/api-services)

```sh
python examples/service.py
python examples/service-test.py
```

## Running tests

```sh
cd pydez
python -m pytest tests/
```

## License

Dezrann is open-source, and developped with the help of many contributors in the [Algomus](https://www.algomus.fr) computer music team and elsewhere.
The Python bindings are licensed under the LGPL version 3 or any later version.
