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.
  • Methods will delete information. For example, comments interlaced with the attributes will not be saved and subsequently overwritten when writing. Changing the version of a song doesn't technically remove information, but could result in your program not being able to parse the file. Programs should disclose what version of the ultrastar file format they are compatible with, but this might not be correct.
  • Ultrastar libraries should be structured like below. Not following this will probably still work, but is not recommended and could cause issues in the future.
library_folder/
├── song_1/
│   ├── song_1.txt
│   ├── song_1.mp3
│   └── ...
├── song_2/
│   ├── song_2.txt
│   ├── song_2.m4a
│   ├── song_2 [CO].jpg
│   └── ...
└── song_3/
    └── ...

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

  • Many more docstrings
  • 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.14.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

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

ultrastarparser-0.6.14-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ultrastarparser-0.6.14.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.13.1 Windows/11

File hashes

Hashes for ultrastarparser-0.6.14.tar.gz
Algorithm Hash digest
SHA256 61ac3f8054a64ca91358f35be3c02860dd22a9f722d50ca6f951e2e015ec1fb8
MD5 94ed2b80a1dffdcc0fb345ceb48fc80e
BLAKE2b-256 8b4673fc74559adb8e019457d6ead83540342a699880236cf4d4ac6038d38d26

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ultrastarparser-0.6.14-py3-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.13.1 Windows/11

File hashes

Hashes for ultrastarparser-0.6.14-py3-none-any.whl
Algorithm Hash digest
SHA256 d19d59dab25960d316f4801e28b2b8058d2aa4fef24e35c4bbed4fc3e3d06844
MD5 b2f0258a8e0b13e3ca941d6d589fb36e
BLAKE2b-256 5c2f95f35d897f2f8fbad82670c0728252e68671947c51e8ec5ecca875ba49da

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