Skip to main content

A Python library for representing and validating musical form annotation labels.

Project description

musicalform

A Python library and infrastructure for modelling musical form.

PyPI version Python versions License: Unlicense


Installation

pip install musicalform

Requirements: Python 3.11+, DHParser 1.8.3+


CLI

The package ships a validate command that tests LCMA form-annotation labels against the current grammar:

# Validate a single expression
musicalform validate -e "bi"

# Validate a text file
musicalform validate -f my_label.txt

# Validate all expressions in a CSV (column: 'expression')
musicalform validate -c annotations.csv

# Extract and validate from a JSON timeline file
musicalform validate -j piece.json -o reports/

# Recursively process a directory of JSON files
musicalform validate -d data/ -o all_results.csv

# Verbose mode (show parse trees and skipped files)
musicalform validate -e "bi" -v

Development

Getting Started

git clone <repo-url>
cd musicalform

# Install in editable mode with dev dependencies
pip install -e ".[dev]"

# Install pre-commit hooks
pre-commit install

Running Tests and Checks

# Run tests for all supported Python versions
tox

# Run tests for a specific Python version
tox -e py311
tox -e py312

# Or use pytest directly
pytest

# Run linters
tox -e lint

# Run type checking
tox -e typecheck

Workflow

All pull requests should target the development branch. Commits follow conventional commit format, which enables semantic versioning:

Commit Message Version Bump Emoji
feat: add new feature Minor (0.x.0)
fix: resolve issue Patch (0.0.x) 🐛
BREAKING CHANGE: description Major (x.0.0) ⚠️
docs: update documentation No release 📚
refactor: reorganize code No release ♻️
test: add tests No release
perf: improve performance No release
chore: maintenance tasks No release 🔧

Release Process

When commits are pushed to development, Release Please automatically:

  1. Analyzes conventional commit messages
  2. Creates a PR with bumped version in pyproject.toml and updated CHANGELOG.md
  3. When merged, creates a GitHub Release

To publish to PyPI after a release is created:

# Build the package
tox -e build

# Publish to PyPI (requires TWINE_API_TOKEN in environment)
tox -e publish

Check your version at any time with:

musicalform --version

License

This project is released into the public domain under the Unlicense. See LICENSE for details.

Project details


Download files

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

Source Distribution

musicalform-0.1.0.tar.gz (22.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

musicalform-0.1.0-py3-none-any.whl (26.4 kB view details)

Uploaded Python 3

File details

Details for the file musicalform-0.1.0.tar.gz.

File metadata

  • Download URL: musicalform-0.1.0.tar.gz
  • Upload date:
  • Size: 22.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for musicalform-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2f9288fa039be4c548ac4e80a581983b360da5a4639a94a043db57c17309cdb7
MD5 74020ac46356e4b43fb4ee1a29c6e52f
BLAKE2b-256 097c74e39f86c742db47683b3a322cbbb5ebefb0b6ecac3d56af5a30c2693e68

See more details on using hashes here.

File details

Details for the file musicalform-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: musicalform-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 26.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for musicalform-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0ae279f68f4dc8f6e3159e53a1cc6165c24a02b646d41a3ec36030fcfe44cae8
MD5 8aa08f41f062cc733d6de180aa887462
BLAKE2b-256 08538b2712a4f6aa80ea722e4ec43f8c226797a527dc27190baea4a86d3fe2bd

See more details on using hashes here.

Supported by

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