chord-chart
This package provides chord chart validation and transposition functionality.
It is written in Rust and has an accompanying library in JavaScript. Used in vrslev/songbook — lyrics and chords webapp.
Example
>>> from chord_chart import ValidationError, transpose_chart, validate_chart
>>>
>>>
>>> validate_chart('| A/E E | E | \n| C#m|')
'| A/E E | E |\n| C#m |'
>>> validate_chart('A/E E\nC#m')
Traceback (most recent call last):
...
_chord_chart.ValidationError: bar line should start with stripe: A/E E
>>> transpose_chart('| A/E| E |\n| C#m|', current_key='E', new_key='Db')
'| Gb/Db | Db |\n| Bbm |'
Installation
Just pip install chord-chart
on Python 3.7 to 3.11.
Development
make install
to clean up and setup dev-env.make test
to build and test the package.make check-types
to run pyright.
Also make sure to install pre-commit hooks (pre-commit install
from the repository root).