Skip to main content

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


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.0.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

ultrastarparser-0.6.0-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file ultrastarparser-0.6.0.tar.gz.

File metadata

  • Download URL: ultrastarparser-0.6.0.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.2 Windows/11

File hashes

Hashes for ultrastarparser-0.6.0.tar.gz
Algorithm Hash digest
SHA256 009b60aa4495620f3e6b2f15489fe5a9818598040e8438393439e238bae578f0
MD5 2dbb7916569946b4912ff7e43b1e03f3
BLAKE2b-256 ed3f2ad8f76b54f6b73d07941ea30032dcd79d43bdacd38ffb757236fc477e4d

See more details on using hashes here.

File details

Details for the file ultrastarparser-0.6.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ultrastarparser-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9b15a47d6943d71235b43e26cb7b75663d9bda0c10cb54f0bd4f50398268e56d
MD5 32bdcb6ad574c8e4e95f78f183bc3f6d
BLAKE2b-256 167e1f7d1ac745065701a9c516a3d198fd7b84b5a70dadc73068d172d2cbfb80

See more details on using hashes here.

Supported by

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