Skip to content

Perlence/PyGuitarPro

Repository files navigation

PyGuitarPro

PyPI Package latest release

Introduction

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.

Examples

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

Installation

Install PyGuitarPro from PyPI:

pip install PyGuitarPro

Documentation

Package documentation is located at Read the Docs.

Development

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

Licensing

Please see the file called LICENSE.

About

Read, write and manipulate GP3, GP4 and GP5 files.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •