Lightweight CUE sheet toolkit for Python
Parsing Cue Sheets (.cuefiles) intoPydanticdata models and validating fields
Serialising data models into Cue Sheets (.cuefiles)
Note: This is an independent Python library. The name cuetools reflects the purpose of the library (handling CUE files) and is not intended to imply any association with other projects of the same name.
- Parse
.cuefiles intoPydanticmodels with built-in validation - Generate
.cuefile content from data - Simple and intuitive API like
jsonstandard library - Lightweight — no external dependencies other than
Pydantic - Fully type-annotated — compatible with
MyPy - Supports Python 3.10+
For a full list of updates, see the CHANGELOG.
Note: Version 1.0.0 includes breaking changes and is not backward compatible with earlier versions, please review the CHANGELOG.
-
Main cue sheet specification https://wiki.hydrogenaudio.org/index.php?title=Cue_sheet
-
Additioonal ReplayGain specification https://wiki.hydrogenaudio.org/index.php?title=ReplayGain_1.0_specification
pip install cuetoolspoetry add cuetoolsimport cuetools
cue_string = """
FILE "track01.flac" WAVE
TRACK 01 AUDIO
TITLE "Intro"
PERFORMER "Artist"
INDEX 01 00:00:00
"""
cue_sheet = cuetools.loads(cue_string)
#cue_sheet is instance of AlbumData class with parsed cue_string
track = cue_sheet.tracks[0]
#track is instance of TrackData class with parsed track data
print(track.file) # Result: track01.flac
print(track.title) # Result: Intro
print(track.performer) # Result: Artist
print(track.index00.string) # Result: 00:00:00MIT