Skip to main content

Chord chart validation and transposition

Project description

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

>>> # that's a valid chart: | *chord-with-bass-note* *chord-without-accidental* | *chord* | *(end of the bar, then new bar ->)*
>>> # | *chord-with-accidental-and-symbols* |
>>> validate_chart('| A/E E | E | \n| C#m|')
'| A/E E | E |\n| C#m |'

>>> validate_chart('A/E E\nC#m')  # and that's not a valid one: chords without stripes between lines of bars
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).

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

chord_chart-0.3.0.tar.gz (6.9 kB view hashes)

Uploaded Source

Built Distributions

chord_chart-0.3.0-cp311-none-win_amd64.whl (103.8 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

chord_chart-0.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (511.5 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

chord_chart-0.3.0-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (413.2 kB view hashes)

Uploaded CPython 3.11 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

chord_chart-0.3.0-cp310-none-win_amd64.whl (103.8 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

chord_chart-0.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (511.5 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

chord_chart-0.3.0-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (413.2 kB view hashes)

Uploaded CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

chord_chart-0.3.0-cp39-none-win_amd64.whl (103.8 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

chord_chart-0.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (511.5 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

chord_chart-0.3.0-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (413.2 kB view hashes)

Uploaded CPython 3.9 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

chord_chart-0.3.0-cp38-none-win_amd64.whl (103.8 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

chord_chart-0.3.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (511.4 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

chord_chart-0.3.0-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (412.1 kB view hashes)

Uploaded CPython 3.8 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

chord_chart-0.3.0-cp37-none-win_amd64.whl (103.7 kB view hashes)

Uploaded CPython 3.7 Windows x86-64

chord_chart-0.3.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (511.4 kB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

chord_chart-0.3.0-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (412.1 kB view hashes)

Uploaded CPython 3.7m macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

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