Skip to main content

Python implementation of the MeasureMap specification

Project description

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/.

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyMeasureMap-0.1.tar.gz (41.3 kB view details)

Uploaded Source

Built Distribution

pyMeasureMap-0.1-py3-none-any.whl (24.4 kB view details)

Uploaded Python 3

File details

Details for the file pyMeasureMap-0.1.tar.gz.

File metadata

  • Download URL: pyMeasureMap-0.1.tar.gz
  • Upload date:
  • Size: 41.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for pyMeasureMap-0.1.tar.gz
Algorithm Hash digest
SHA256 12e2b6c01ad0e1ab75fca5ab7781850047b2ce3bddf54e7cc1935275f4e9aeb8
MD5 07ad050929218cd46731b2241be831a1
BLAKE2b-256 b93db15917eac61f00e9793a193726d295128d95854da6a0cff7000ad7e6cb82

See more details on using hashes here.

File details

Details for the file pyMeasureMap-0.1-py3-none-any.whl.

File metadata

  • Download URL: pyMeasureMap-0.1-py3-none-any.whl
  • Upload date:
  • Size: 24.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for pyMeasureMap-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7f0d4d6884a9528255f2ab1035d00dd91c87bf4bc6f2c84014034a589adc3116
MD5 83c74d9864d0f655e81e3e1fe1df4edf
BLAKE2b-256 ae8668e01efe5416cd105784e48901ce3a83e1c4c739823c6a942fe4deae49fc

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page