PyGuitarPro is a package to read, write and manipulate GP3, GP4 and GP5 files. Initially PyGuitarPro is a Python port of AlphaTab which originally was a Haxe port of TuxGuitar.
This package helps you achieve several goals you might find yourself yearning to do in a day-to-day tabber life:
- Transpose a track without messing the fingering
- Add the first string to the track without messing the fingering
- Map percussion notes to different values
Reading .gp*
files is as easy as:
import guitarpro
curl = guitarpro.parse('Mastodon - Curl of the Burl.gp5')
Writing .gp*
files isn't that hard either:
guitarpro.write(curl, 'Mastodon - Curl of the Burl 2.gp5')
All objects representing GP entities are hashable and comparable. This gives a great opportunity to apply the diff algorithm to tabs, or even the diff3 algorithm to merge tablatures.
For those looking to create the best guitar tablature editor in Python, this package is a good place to start.
Several usage examples are included in the /examples
folder. Feel free to add your own examples or improve existing
ones. Then, submit them via pull request.
To run one of the examples in your local environment, simply:
cd PyGuitarPro
uv run examples/transpose.py --help
Install PyGuitarPro from PyPI:
pip install PyGuitarPro
Package documentation is located at Read the Docs.
Install the development version of PyGuitarPro with uv:
git clone https://github.com/Perlence/PyGuitarPro.git
cd PyGuitarPro
uv sync
Run the tests:
uv run pytest
Install the pre-commit hook:
uv run pre-commit install
Please see the file called LICENSE
.