-
Notifications
You must be signed in to change notification settings - Fork 4
Home
Since we’re still in heavy development, this information is subject to change.
This is a Python library to read/write Music Encoding Initiative (MEI) files. While MEI is usually expressed in XML, this library abstracts the XML representation, parsing the MEI entities into Python objects. This is to allow for alternative representations to be output, e.g., a MEIXML file can be read in and converted to a JSON representation, or vice-versa.
The requirements for this library are straightforward. It requires Python 2.6 or later (not tested yet on Python 3.x, though) and the lxml XML processing library. All other modules should be built in to Python.
As of now, this library has only been tested on OS X. There should be no reason, however, that it should not run on any other platform that supports Python 2.6+ and lxml.
Installing should be as easy as downloading the code, changing to the module directory and running:
sudo python setup.py install
If it isn’t, something has gone terribly wrong. You can test if it has installed correctly by opening the Python interpreter and running:
import pymei
No errors? Peachy.
Here are some examples of how to use this library directly. Longer examples may be found in the Examples folder in the source.
from pymei.Import import convert
meifile = convert("/Path/to/file.mei")
notes = meifile.search('note')