Skip to main content
Project generated with PyScaffold

pyMeasureMap

Python implementation of the MeasureMap specification

Usage

  1. Clone the repository

  2. Install the package:

    • If you only want to use the package, install it with pip:

      pip install .

      (where . stands for the directory with your local clone)

    • If you want to run the tests:

      pip install ".[testing]"
    • If you want to contribute, make sure to include -e (for editable) and run:

      pip install -e ".[dev]"

Running all tests

To run the tests you need a clone of the aligned_bach_chorales repository. By default, it will be cloned into your home directory under ~/git. To set it up yourself:

  • Clone aligned_bach_chorales (submodules not required)

  • Point pyMeasureMap’s tests to the directory of the clone by setting the constant REPOSITORY_PATH to the directory that includes the aligned_bach_chorales directory.

To run the tests, head to your pyMeasureMaps clone and run tox.

Command line interface

Once the package is installed, the MM will be available in your commandline. Typing it will print the available sub-commands.

Extracting measure maps

Type MM extract -h to print the help with all arguments.

Parsing all files in path/to/chorales that music21 can parse:

MM extract -d path/to/corpus                    # creates measure maps next to the parsed files
MM extract -d path/to/corpus -o path/to/output  # creates measure maps in the specified directory
MM extract -d path/to/corpus -r "^bwv"          # only parses files that match the regex (i.e., start with "bwv")
MM extract -d path/to/corpus -x .mxl .xml       # only parses files with the specified extensions

Loading and writing

mm = MeasureMap.from_json_file("path/to/file.mm.json")
mm.to_json_file("path/to/new_file.mm.json")

Compress a MeasureMap object

mm = MeasureMap.from_json_file("path/to/file.mm.json")
compressed = mm.compress()
compressed.to_json_file("path/to/compressed.mm.json")

Making Changes & Contributing

This project uses pre-commit, please make sure to install it before making any changes:

pip install pre-commit
cd pyMeasureMap
pre-commit install

It is a good idea to update the hooks to the latest version:

pre-commit autoupdate

Don’t forget to tell your contributors to also install and use pre-commit.

Note

This project has been set up using PyScaffold 4.5. For details and usage information on PyScaffold see https://pyscaffold.org/.

Metadata

Release files for pyMeasureMap 0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyMeasureMap 0.1
File Size Uploaded
pyMeasureMap-0.1.tar.gz 41.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyMeasureMap 0.1
File Interpreter ABI Platform
pyMeasureMap-0.1-py3-none-any.whl Python 3 none any Details

Total release size: 65.7 kB

Release files / pyMeasureMap-0.1.tar.gz

Download URL pyMeasureMap-0.1.tar.gz
Size 41.3 kB
Tags Source
SHA-256 checksum
How to use checksums
12e2b6c01ad0e1ab75fca5ab7781850047b2ce3bddf54e7cc1935275f4e9aeb8
BLAKE2b-256 checksum
How to use checksums
b93db15917eac61f00e9793a193726d295128d95854da6a0cff7000ad7e6cb82
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Release files / pyMeasureMap-0.1-py3-none-any.whl

Download URL pyMeasureMap-0.1-py3-none-any.whl
Size 24.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7f0d4d6884a9528255f2ab1035d00dd91c87bf4bc6f2c84014034a589adc3116
BLAKE2b-256 checksum
How to use checksums
ae8668e01efe5416cd105784e48901ce3a83e1c4c739823c6a942fe4deae49fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Release history Release notifications | RSS feed

This release

0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page