Skip to main content

Tools for building iRealPro songs.

Project description

PyRealPro

The pyrealpro module provides classes that can be used to build a representation of a song, and render it in the import URL format used by the iRealPro app. It assumes that you have a passing familiarity with the iRealPro import format, but hopefully makes it easier to programmatically construct an iRealPro song than resorting to brute-force string concatenation.

Concepts

The Song class is used to define a song that you wish to import into iRealPro. In addition to basic information like title, composer, key, and style, a song's measures property may contain a list of Measure objects.

A Measure object's chords property will have one or more chord names, as well as additional properties that describe time signature (as a TimeSignature object), barlines, endings, rehearsal marks, and text to be displayed underneath.

The TimeSignature class provides simple objects used by the Measure class to properly format the output ultimately used by the Song class to generate an iRealPro URL.

Example

from pyrealpro import Song, Measure, TimeSignature

s = Song(title="Automation Blues", composer="pyrealpro", key='G', style='New Orleans Swing',
                 composer_name_first="Otto",
                 composer_name_last="Matonne")

s.measures.append(Measure(chords='G7', barline_open='{', staff_text='Generated by pyrealpro'))
s.measures.append(Measure(chords='G7'))
s.measures.append(Measure(chords='G7'))
s.measures.append(Measure(chords='G7', barline_close=']'))

s.measures.append(Measure(chords='C7', barline_open='['))
s.measures.append(Measure(chords='C7'))
s.measures.append(Measure(chords='G7'))
s.measures.append(Measure(chords='G7', barline_close=']'))

s.measures.append(Measure(chords='D7', barline_open='['))
s.measures.append(Measure(chords='C7'))

s.measures.append(Measure(chords='G7', ending='N1'))
s.measures.append(Measure(chords='D7', barline_close='}'))

s.measures.append(Measure(chords='G7', ending='N2'))
s.measures.append(Measure(chords='G7', barline_close='Z'))

print(s.url())

The above program will output the following URL, which can be imported into iRealPro:

irealbook://Automation%20Blues=Matonne%20Otto=New%20Orleans%20Swing=G=n=%7BT44%3CGenerated%20by%20pyrealpro%3EG7%20%20%20%7CG7%20%20%20%7CG7%20%20%20%7CG7%20%20%20%5D%5BC7%20%20%20%7CC7%20%20%20%7CG7%20%20%20%7CG7%20%20%20%5D%5BD7%20%20%20%7CC7%20%20%20%7CN1G7%20%20%20%7CD7%20%20%20%7DN2G7%20%20%20%7CG7%20%20%20Z

iReal Pro File Format Reference

https://irealpro.com/ireal-pro-file-format/

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

pyrealpro-0.1.3.tar.gz (9.4 kB view hashes)

Uploaded Source

Built Distribution

pyrealpro-0.1.3-py3-none-any.whl (12.4 kB view hashes)

Uploaded Python 3

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