Skip to main content

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

Project description

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.

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

compile_songbook-0.1.1.tar.gz (3.0 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

compile_songbook-0.1.1-py3-none-any.whl (3.0 MB view details)

Uploaded Python 3

File details

Details for the file compile_songbook-0.1.1.tar.gz.

File metadata

  • Download URL: compile_songbook-0.1.1.tar.gz
  • Upload date:
  • Size: 3.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.2

File hashes

Hashes for compile_songbook-0.1.1.tar.gz
Algorithm Hash digest
SHA256 43440edd8432ff317b4ab930d48ac8c3c846d8c610ed2a45877e9144a3995f5d
MD5 7881db7b14f919fd50859c4b439ca423
BLAKE2b-256 e4e2df76fdeb889e4bbbaa2706955c0b43dad7744ad7897cbce60d5e196f2fc0

See more details on using hashes here.

File details

Details for the file compile_songbook-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for compile_songbook-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5b186973cf69cc0f32f646532b47d208de4fdc3d29cf7bd340dcff06bdd05eef
MD5 f40bd91cf7795cae71a88e01ab5d4594
BLAKE2b-256 2562c44aa164461d01c1b2f8dad12d8d0a48586248ce6cc561373c5f6d4e28da

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page