Skip to main content

songbook and songsheet management for songsheets in ukedown format

Project description

udn-songbook

What'cha talkin' about, Willis?

udn-songbook is a class-based abstraction of a songbook, using the ukedown rendering engine. Long-term it is intended to replace most of the code from the ukebook-md tools. In the end, you should be able to take the code from here and create (and render) songbooks with it, producing PDFs and/or HTML (and possibly other formats, if I add them).

Requirements

Python packages

  • ukedown (markdown extensions)
  • weasyprint (PDF generation)
  • pychord (chord management)

development requirements - for future project enhancements

  • python-fretboard (chord generation)

The TL;DR

How to use the current functionality

(it only does basic things at the moment)

from udn_songbook import Song
s = song('/path/to/filename')

# list the unique chords in the song
s.chords

# save it to disk
s.save(outputfile)

# transpose by an arbitrary number of semitones
s.transpose(semitones)

# generate a PDF from the current song, using built-in templates
s.pdf()

And to build a songbook, use the SongBook class, with a directory of UDN-format songsheets

from udn_songbook import SongBook
mybook = SongBook(inputs=['directory1', 'directory2', 'someotherfile.udn'])

Songbooks have an index auto-generated, and do not support mutiple songs with the same ID (which is essentially "Title - Artist").

If your inputs include multiple songs in this way, the last one imported will be used. So name them carefully.

A Songbook in this context is a collection of song objects with additional metadata, such as an index.

Tools

The pip package also installs 2 commandline tools, aimed at managing individual songsheets:

udn_transpose, which allows in-place (or optionally to a new file) transposing of an existing songsheet by an arbitrary number of semitones. The transposition is added to metadata

udn_songsheet, which renders a UDN songsheet to a file in either PDF (default) or HTML format. it also supports in-place transposition, without affecting the original input file.

what you need to use this:

  • a directory full of UDN-format files.
  • templates:
    • index.html.j2
    • song.html.j2
  • stylesheets (up to you, you can pass their names and location to the methods)
    • pdf.css
    • ukedown.css

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

udn_songbook-1.4.2.tar.gz (1.4 MB view details)

Uploaded Source

Built Distribution

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

udn_songbook-1.4.2-py3-none-any.whl (39.4 kB view details)

Uploaded Python 3

File details

Details for the file udn_songbook-1.4.2.tar.gz.

File metadata

  • Download URL: udn_songbook-1.4.2.tar.gz
  • Upload date:
  • Size: 1.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.21

File hashes

Hashes for udn_songbook-1.4.2.tar.gz
Algorithm Hash digest
SHA256 d7216b19fbd0845a979d68eda8cb698d123cf172b928766d456410d5891de8ac
MD5 a36329d4e8a99c53a4f40f9d8fe18a4c
BLAKE2b-256 5f7085d72d07e3cea909a649ee6684a06ce405645321348e472d34b885850eb5

See more details on using hashes here.

File details

Details for the file udn_songbook-1.4.2-py3-none-any.whl.

File metadata

File hashes

Hashes for udn_songbook-1.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4210e8f6c198767e715599c2a30a83c49f0f8b6fcefe50a132fd1a9f039a65bb
MD5 3877d138e690b184c5fbb02f9b8f5f78
BLAKE2b-256 896723075e625627d310bb413dbded6416899dd5c96ce7a2d9418856ff8e3af4

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