A ChordPro parser, written in Python. https://igitar.com
Go to file
Raoul Snyman 6e96953ed8 Updated README with a warning 2021-07-28 21:44:06 -07:00
src/chordpro Various updates, including a new text renderer 2021-07-28 11:41:15 -07:00
.gitignore Update ignores 2021-07-28 21:41:58 -07:00
LICENSE Initial commit 2021-07-24 06:33:16 +00:00
README.rst Updated README with a warning 2021-07-28 21:44:06 -07:00
pyproject.toml Add setuptools data for building a package 2021-07-28 21:39:43 -07:00
setup.cfg Add setuptools data for building a package 2021-07-28 21:39:43 -07:00
setup.py Add setuptools data for building a package 2021-07-28 21:39:43 -07:00

README.rst

python-chordpro

python-chordpro is a ChordPro parser, written in Python. The main difference between this module and other similar libraries is that python-chordpro parses ChordPro files down to the syllable level, enabling finer-grained control of the formatted output.

Warning

This package is still in development. Only a subset of ChordPro is currently supported, and some key features are missing, like displaying song metadata.

Installation

You can use pip to install python-chordpro:

$ pip install python-chordpro

Example Usage

from chordpro import Song

song = Song('path/to/song.chordpro')

for verse in song.verses:
    print(verse.title)

Rendering

python-chordpro comes with two renders, HTML and Text.

from chordpro.renderers.html import render

print(render(song))

Command Line Interface

python-chordpro also ships with a built-in command line interface which will read a ChordPro file and then render it using either the text or HTML renderer.

For example:

$ python-chordpro path/to/song.chordpro -f text -o song.txt

License

python-chordpro is licensed under the MIT license. See the LICENSE file for more information.