Skip to content
This repository has been archived by the owner on Jun 27, 2018. It is now read-only.
ahankinson edited this page Dec 2, 2010 · 18 revisions

Since we’re still in heavy development, this information is subject to change.

Introduction

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.

Requirements

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

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.

Usage Examples

Here are some examples of how to use this library directly. Longer examples may be found in the Examples folder in the source.

Find all the notes in a piece
 from pymei.Import import convert
 meifile = convert("/Path/to/file.mei")
 notes = meifile.search('note')

Library Structure

Clone this wiki locally