Some helpful stuff for displaying song chords (or just the bare chords) for string instruments.
Installation
Just run pip install chordist or pipx install chordist.
CLI
When installed, the CLI command chordist will be made available.
$ chordist
usage: chordist [-h] [--instrument {guitar,banjo}] [--file FILE] [--chords-inline] [--collect-chords] [--even-x-distance] [--maxlen MAXLEN] [--variations] [--ascii] [--transpose TRANSPOSE]
options:
-h, --help show this help message and exit
--instrument {guitar,banjo}, -i {guitar,banjo}
Default: guitar
--file FILE, -f FILE Text file with songs; if absent, all chords for the instrument will be printed
--chords-inline Input file uses the 'inlined chords' notation
--collect-chords When printing multiple songs, output all chords at the bottom instead of individually for each song
--even-x-distance Draw chords on equal distances horizontally
--maxlen MAXLEN Maximum output row length (default: 50)
--variations Print all available variations of each chord
--ascii Print chords in their simplified, ASCII only forms
--transpose TRANSPOSE
Transpose all chords in the input file by this number of half notes
On the input text file
A sequence of 2 or more empty rows will be interpreted as a boundary between two songs.
If a song is prefixed by a line enclosed in ** (two asteriskes), the string within will be used for the song title.
Chords in the input file may be written in an inline fashion, like this:
**Roll in my sweet baby's arms**
[G]Roll in my sweet baby's arms
Roll in my sweet baby's [D7]arms
Gonna [G]lay around the shack
'Til the [C]mail train comes back
And [D7]roll in my sweet baby's [G]arms
... or above the lyrics, like this:
**Roll in my sweet baby's arms**
G
Roll in my sweet baby's arms
D7
Roll in my sweet baby's arms
G
Gonna lay around the shack
C
'Til the mail train comes back
D7 G
And roll in my sweet baby's arms
Use the --chords-inline parameter for the former notation. Note that the notation needs to be consistent throughout the file.
Chords may be written in the fancy, correct way ("A♭⁷", "C♯m⁷") or the simplified/ASCII way ("Ab7", "C#m7").
Defining chords
A chord can be defined like so:
from chordist.banjo import BanjoChord
em = BanjoChord.create("Em", (2, 1, 2), (2, 4, 3))
g = BanjoChord.create("G")
... where the arguments to BanjoChord.create() are the chord name followed by a tuple in the format (fret number, string number, [finger number]) for each pressed string. String numbers are counted from the top/left, which I am sure somebody will take issue with (feel free to change this in your own fork in that case). The finger number can be omitted, in which case a * will be used. It can also be a string, for example x for muted strings.
Bugs/caveats
Not yet able to render the high G string on a 5-string banjo in any useful way.
Metadata
Release files for chordist 0.4.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 |
|---|---|---|---|---|
| chordist-0.4.0.tar.gz | 26.6 kB | Without provenance | Details for chordist-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| chordist-0.4.0-py3-none-any.whl | Python 3 | none | any | Details for chordist-0.4.0-py3-none-any.whl |
Total release size: 54.8 kB
Release files / chordist-0.4.0.tar.gz
| Download URL | chordist-0.4.0.tar.gz |
|---|---|
| Size | 26.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7aa5687d1ba7808aeca1c4778ef90275524d1c8be88837f1008c7cc83c6b640b
|
|
BLAKE2b-256 checksum How to use checksums |
355f45cf937d542a73ba14af12b69aa211ec851cb658d400d1e70394b633d44c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Release files / chordist-0.4.0-py3-none-any.whl
| Download URL | chordist-0.4.0-py3-none-any.whl |
|---|---|
| Size | 28.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e99983cb127c5e27919cc7c9f418ebff0d9a0b0b94442782ab64974ea3102d19
|
|
BLAKE2b-256 checksum How to use checksums |
79173cd29e426efdae555b1d4d9a9e6b44b25c839bbb098d3b3398bfc30b1390
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Security for chordist 0.4.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.