Parser for Ultrastar text files.
Project description
UltrastarParser
Contains methods to read or edit ultrastar files or directories.
Installation
Use the package manager of your choice: pypi.
Usage tips
- Make a backup of the text files. The library currently does not touch any other files. Though I try very hard to fix bugs and use the library myself, I cannot guarantee your files won't go up in flames, particularly if you are using a non-standard file structure or encoding. If something does go wrong, please file an issue.
- Certain formattings will be lost. For example, attributes (like #ARTIST) will always be converted to uppercase. Same goes for empty lines in the attributes section. The current goal is to be able to parse files that adhere to the Official Ultrastar Format Specification. For everything else, a best effort is made.
Features
from ultrastarparser import Song, Library
song = Song('path_to_txt_file')
song.get_attribute('ARTIST') # Returns song artist
song.set_attribute('ARTIST', 'Bon Jovi') # Set song artist
song.set_version('1.1.0') # Set song file version. See https://usdx.eu/format.
song.flush() # Flush changes made to the file system.
lib = Library('path_to_library')
for s in lib:
# check for somthing in every song
songs_by_bon_jovi = lib.search('ARTIST', 'Bon Jovi') # Returns all songs with Bon Jovi as artist
lib.export('export_path', 'json') # exports library to path as certain format.
Planned features
- Ability to backup files, for example before overwriting
- Logging
- Better error handling (and documentation of error handling)
- Metadata extraction not from txt file (e.g. song duration from audio file or video resolution from video file)
Unplanned features
- Editing the songtext and notes
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ultrastarparser-0.6.3.tar.gz
(9.2 kB
view details)
Built Distribution
File details
Details for the file ultrastarparser-0.6.3.tar.gz
.
File metadata
- Download URL: ultrastarparser-0.6.3.tar.gz
- Upload date:
- Size: 9.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.12.2 Windows/11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b155bc95f55ac25c5c74a6df9eb4eeea087616a355068b11b713a930f1c7de07 |
|
MD5 | 9768c74307b3b5468535581be952b55f |
|
BLAKE2b-256 | c79932976fd5fcc3d33127f10187caee31ec2a18c49e9e4597d8ec69bb40bf4c |
File details
Details for the file ultrastarparser-0.6.3-py3-none-any.whl
.
File metadata
- Download URL: ultrastarparser-0.6.3-py3-none-any.whl
- Upload date:
- Size: 10.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.12.2 Windows/11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8456ffa5c8d40ffa9d13c7b14555f8af9ef1232a002b4cb6f8c4c8b9a1dafaec |
|
MD5 | bab7d7d7b7ac8b11f0a4b68833346214 |
|
BLAKE2b-256 | 494a1b5c9e490cb5cce94a42cbb8b65445c3b87adc5382c2f7f92935581e9433 |