Hi,

As I was annoyed by the code needed to automatically download LilyPond in the 
“extending-lilypond” guide, I created a “lilypond” project on PyPI...

[https://pypi.org/project/lilypond](https://pypi.org/project/lilypond)

... and uploaded wheels to it using a tiny script which lives at ...

[https://gitlab.com/jeanas/lilypond-wheels](https://gitlab.com/jeanas/lilypond-wheels)

Ok, if that was all Chinese to you, what this basically means is that just like 
there is a LilyPond package in Linux distros, on Homebrew, MacPorts, 
Chocolatey, and so on, there is now also a Python package, making it convenient 
to use LilyPond in Python scripts. It's used like this:

```
import subprocess
import lilypond

subprocess.run([lilypond.executable(), "file.ly"])
```

It can be installed with pip, the standard tool for installing Python packages. 
The whole point is that this doesn't just install a wrapper that looks for 
LilyPond on the system. It really comes with its own copy of LilyPond. That 
means you can just add "lilypond" as a dependency to your pyproject.toml, 
tox.ini, requirements.txt, or wherever your other Python dependencies are, and 
Bob's your uncle, without requiring your users to install LilyPond separately 
from your Python module. You can pin the LilyPond version by writing the 
requirement as “lilypond==2.24.1”, or do basically anything you can do with 
plain Python packages.

I'll try to remember to update it with each LilyPond release.

Note that I have not tested the macOS and Windows wheels, I'd be interested to 
know whether they are working...

Jean

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to