Skip to content

Commit

Permalink
Merge pull request rism-digital#3935 from rettinghaus/develop-libmei
Browse files Browse the repository at this point in the history
Update libmei
  • Loading branch information
ahankinson authored Feb 3, 2025
2 parents 140e3db + c81a945 commit f4bf7d9
Show file tree
Hide file tree
Showing 6 changed files with 123 additions and 108 deletions.
24 changes: 18 additions & 6 deletions libmei/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
LibMEI
------

LibMEI is a C++ library for reading and writing [MEI](http://music-encoding.org) files
LibMEI is a C++ library for reading and writing [MEI](https://music-encoding.org/) files

It was originally developed by the [Distributed Digital Music Archives and Libraries Lab](http://ddmal.music.mcgill.ca/) at the Schulich School of Music at McGill University, Montréal, Canada
It was originally developed by the [Distributed Digital Music Archives and Libraries Lab](https://ddmal.music.mcgill.ca/) at the Schulich School of Music at McGill University, Montréal, Canada

This is a modified version that is used for generating C++ code for Verovio.

Expand All @@ -22,17 +22,29 @@ Compilation & Usage
To install you can use Python `poetry` which will create a virtual environment and automatically
install the necessary dependencies. The first time you get things set up, from the `libmei` directory run:

$> poetry install
```shell
poetry install
```

This will set up a virtual environment for you. When you want to activate the environment, run

$> poetry shell
```shell
poetry env activate
```

This allows you to run Python with all the necessary dependencies for running the libmei scripts.
This will show you the command to activate the virtual environment.

To generate the code, activate the poetry environment and, from the `libmei` directory, run:

$> python3 tools/parseschema2.py ./mei/mei-verovio_compiled.odd
```shell
python3 tools/parseschema2.py ./mei/mei-verovio_compiled.odd
```

If you don't want to activate the virtual environment manually, use:

```shell
poetry run python3 tools/parseschema2.py ./mei/mei-verovio_compiled.odd
```

Where the positional argument points to an ODD file for which you wish to generate code.

Expand Down
10 changes: 6 additions & 4 deletions libmei/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 17 additions & 9 deletions libmei/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
[tool.poetry]
[project]
name = "libmei"
version = "0.1.0"
description = ""
authors = ["Andrew Hankinson <[email protected]>"]
dependencies = [
"pyyaml (>=6.0)",
"lxml (>=5.3.0)",
]
requires-python = ">=3.9"
description = "LibMEI is a C++ library for reading and writing MEI files"
authors = [
{name = "Andrew Hankinson", email="[email protected]"},
]
readme = "README.md"
license = "MIT"

[tool.poetry.dependencies]
python = "^3.9"
pyyaml = "^6.0"
lxml = "^5.3.0"

[tool.poetry]
package-mode = false

[build-system]
requires = ["poetry-core"]
requires = ["poetry-core>=2.0"]
build-backend = "poetry.core.masonry.api"

[tool.ruff]
line-length = 120
Loading

0 comments on commit f4bf7d9

Please sign in to comment.