Skip to main content

songbook

Tool for compiling text files containing lyrics into a single PDF.

How to run

This tool is designed with Linux systems bundling GNU roff (groff) on them. There are two primary ways to install this tool, but in either case, you will need to install the uv package manager:

Using uvx

The simplest way to run this tool is to use the uvx command. Installation is handled in a temporary virtual environment behind the scenes.

uvx compile-songbook path/to/my/songs output/songbook.pdf --title="My songs" --author="Bob"

As a developer

If you are familiar with groff, the more hands-on method is to clone the code.

git clone https://github.com/clockback/songbook
cd songbook

You can then use uv to run the code like so:

uv run compile-songbook path/to/my/songs output/songbook.pdf --title="My songs" --author="Bob"

The source code is written in Python and easy to modify if you wish to apply further customization.

Formatting songs

When you provide an argument to identify your songs (e.g. path/to/my/songs), all files in that directory will need to follow the following format:

Title: Song of the Flamingos

This is the first verse,
These words are all I've got,
Do you like flamingos?
I most certainly do not...

Chorus

No I don't like flamingos,
I don't like them one jot,
They cause me so much trouble,
Yes I despise them such a lot...

This is the second verse,
It's no better than the first,
I'll desist from writing more verses,
They'll probably get worse.

Chorus

Chorus

The first line constitutes metadata for the song, and a number of optional fields may be provided, for example:

Title: Song of the Flamingos
Composers: Joseph Derbyshire
Lyricists: Colin Kirk
Language: English
Category: Comedy songs
Formatting: Compact

The Language field is not presently used. The Formatting field can be set to Plain (default) or Compact, the latter of which will reduce the paragraph spacing.

Release files for compile-songbook 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for compile-songbook 0.1.1
File Size Uploaded
compile_songbook-0.1.1.tar.gz 3.0 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for compile-songbook 0.1.1
File Interpreter ABI Platform
compile_songbook-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size:5.9 MB

Release files / compile_songbook-0.1.1.tar.gz

Download URL compile_songbook-0.1.1.tar.gz
Size 3.0 MB
Tags Source
SHA-256 checksum
How to use checksums
43440edd8432ff317b4ab930d48ac8c3c846d8c610ed2a45877e9144a3995f5d
BLAKE2b-256 checksum
How to use checksums
e4e2df76fdeb889e4bbbaa2706955c0b43dad7744ad7897cbce60d5e196f2fc0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.2

Release files / compile_songbook-0.1.1-py3-none-any.whl

Download URL compile_songbook-0.1.1-py3-none-any.whl
Size 3.0 MB
Tags Python 3
SHA-256 checksum
How to use checksums
5b186973cf69cc0f32f646532b47d208de4fdc3d29cf7bd340dcff06bdd05eef
BLAKE2b-256 checksum
How to use checksums
2562c44aa164461d01c1b2f8dad12d8d0a48586248ce6cc561373c5f6d4e28da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.2

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page