pyRealParser
A Python package to read songs in the iRealPro format.
Introduction & Usage
Here's an example of how to import an iReal link and print the information it contains:
>from pyRealParser import Tune
>my_tune = Tune.parse_ireal_url('irealb://%44%65%61%72<link shortened>')[0]
>print(my_tune)
<pyRealParser.Tune object at 0x107305e80>
Title: Dear Old Stockholm
Composer: Traditional
Style: Medium Swing
Key: D-
Transpose: None
Comp style: 0
BPM: 0
Repeats: None
Time signature: 4/4
Chord string:
*A{T44D- |Eh7 A7b9|G-7 C7|F^7 |Eh7 A7b9|D- |Eh7 |A7b9 |D-7 |D-6 |D-7 |D-6 }*B[F^7 |G-7 C7|F^7 |Eh7 A7b9 ]*C[D- |Eh7 A7b9|G-7 C7|F^7 |Eh7 A7b9|D- |C7sus |x |C7sus |x |x |x |C7sus A7b9|D- |x
Flattened measures:
| D- | Eh7A7b9 | G-7C7 | F^7 |
| Eh7A7b9 | D- | Eh7 | A7b9 |
| D-7 | D-6 | D-7 | D-6 |
| D- | Eh7A7b9 | G-7C7 | F^7 |
| Eh7A7b9 | D- | Eh7 | A7b9 |
| D-7 | D-6 | D-7 | D-6 |
| F^7 | G-7C7 | F^7 | Eh7A7b9 |
| D- | Eh7A7b9 | G-7C7 | F^7 |
| Eh7A7b9 | D- | C7sus | C7sus |
| C7sus | C7sus | C7sus | C7sus |
| C7susA7b9 | D- | D- |
parse_ireal_urlreturns a list of Tune objects, each representing a song contained in the input url. They contain a number of member variables, containing the chords as well as some meta information:
chord_string: A single string that has all chords of the tune, with bar lines, repeat markers, endings, codas etc:
>print(my_tune.chord_string)
*A{T44D- |Eh7 A7b9|G-7 C7|F^7 |Eh7 A7b9|D- |Eh7 |A7b9 |D-7 |D-6 |D-7 |D-6 }*B[F^7 |G-7 C7|F^7 |Eh7 A7b9 ]*C[D- |Eh7 A7b9|G-7 C7|F^7 |Eh7 A7b9|D- |C7sus |x |C7sus |x |x |x |C7sus A7b9|D- |x
measures_as_strings: A list, for which every element corresponds to a single bar, containing the chords in string form. Repeats, codas etc. have been flattened.
>print(my_tune.measures_as_strings)
*['D-', 'Eh7A7b9', 'G-7C7', 'F^7', 'Eh7A7b9', 'D-', 'Eh7', 'A7b9', 'D-7', 'D-6', 'D-7', 'D-6', 'D-', 'Eh7A7b9', 'G-7C7', 'F^7', 'Eh7A7b9', 'D-', 'Eh7', 'A7b9', 'D-7', 'D-6', 'D-7', 'D-6', 'F^7', 'G-7C7', 'F^7', 'Eh7A7b9', 'D-', 'Eh7A7b9', 'G-7C7', 'F^7', 'Eh7A7b9', 'D-', 'C7sus', 'C7sus', 'C7sus', 'C7sus', 'C7sus', 'C7sus', 'C7susA7b9', 'D-', 'D-']
title: The titlecomposer: The composerstyle: The style (e.g. 'Swing', 'Bossa', 'Blues' etc.)key: The key (e.g. 'A', 'F#' etc)transpose: How many semitones to transposecomp_style: Accompaniment style (usually empty)bpm: Tempo in BPM (usually empty)repeats: How many repeats (usually empty)time_signature: Time signature as a tuple (e.g. (3,4), (4, 4), (5, 8) etc.)
Notice, that some of these meta-data fields might be empty, depending on the input url.
Tune objects are designed to have a nice textual representation in Jupyter notebooks, but can be used outside of a notebook perfectly well.
For more documentation, please read the code.
Contributions are welcome, please submit a PR.
Installation
pip install pyRealParser
Acknowledgements
Kudos to @pianosnake and @ironss for figuring out the iReal url format!
Metadata
Release files for pyRealParser 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyRealParser-0.1.0.tar.gz | 7.5 kB | Without provenance | Details for pyRealParser-0.1.0.tar.gz |
Release files / pyRealParser-0.1.0.tar.gz
| Download URL | pyRealParser-0.1.0.tar.gz |
|---|---|
| Size | 7.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8a532dabb21909dc82d68fa82ad9bfb95ebc3f1d6a3c8398616d87081415fca4
|
|
BLAKE2b-256 checksum How to use checksums |
e708fadfd3ffc69624dd34a05cb33a7e067dc1dad876572375f8478b221079e2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for pyRealParser 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.