Skip to content

AndreasKreuzer/vinyl-label

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vinyllabel - create labels from ID3 tags

This program reads meta data from aiff audio files. The audio stream waveform picture will be rendered into a png image. Album, track information and the waveform picture can be freely used in templated html files.

example

Installation

Following dependencies need to be fullfilled.

pip install mutagen
pip install jinja2
pip install pydub
pip install Pillow

Usage

vinyllabel.py [-h] [--template T] [--debug D] PATH

Configuration

Using conf/config.json you are free to map ID3 meta tags on to keys. Each key will be present in the jinja2 html template. Use --debug argument to print all tags present in a media file.

"keymapping": {
        "album": {
            "name": "TALB",
            "artist": "TPE2",
            "publisher": "TPUB",
            "country": "TXXX:COUNTRY",
            "year": "TDRC"
        },
        "track": {
            "pos": "TRCK",
            "title": "TIT2",
            "artist": "TPE1",
            "key": "TKEY",
            "genre": "TCON",
            "bpm": "TBPM",
            "rpm": "TXXX:TMT/TT",
            "energy": "TXXX:EnergyLevel"
        }
    }

Tag content can be modified freely by regular expressions. In this example key and bpm are getting removed from the track title.

    "regex": {
        "track": {
            "title": "^[0-9]+[a-zA-Z]+ - [0-9]+ - (.*)$"
        }
    }

ID3 tags

Generating or adding tags

ID3 tags are generated by programs like iTunes or added later by programs like Mp3tag or TagScanner. Programs like Recordbox, Engine PRIME or Serato are also analysing audio data and thus generating additional meta data.

See mutagen-specs.readthedocs.io for a reference how ID3 tags are being used.

Special keys

Following keys are coming from the media file header or are altered by vinyltag.

Key Value Description
length track length Does not need to be mapped. Comes from audio stream.
pos track number/total Comes from TRCK tag. Needs to be mapped into pos key to calculate key's below.
posnumber track number Comes from pos key.
postotal total tracks Comes from pos key.
posvinyl vinyl pos Vinyl side letter and track number.

Templates

This program uses the jinja2 templating engine. As such you are free to generate any output file format (for example xml or csv). In the default template we are using as demonstration simple html enriched by a css stylesheet.

See jinja.palletsprojects.com as a reference for syntax.

Template file

Use the --template argument along with your jinja template file name. You are free to create multiple templates.

Template folder

Use a folder with the same name as the template for additional data (for example a css stylesheet). This folder gets exported along with the rendered template.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published