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 librarys should be structured like below. Not following this will probably still work, but is not reccomended 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
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.5.tar.gz
(9.6 kB
view details)
Built Distribution
File details
Details for the file ultrastarparser-0.6.5.tar.gz
.
File metadata
- Download URL: ultrastarparser-0.6.5.tar.gz
- Upload date:
- Size: 9.6 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 | b3a3655e2bff0d7d4e57be8442de741b0e8cae5045f9fe7446691ecdb0cad64e |
|
MD5 | 2de68c36f8a48888e290855bf76b0394 |
|
BLAKE2b-256 | f06aa23fed910ceaa459065375c816c4b1fd57d4f3e24e72d3eaa093a692845b |
File details
Details for the file ultrastarparser-0.6.5-py3-none-any.whl
.
File metadata
- Download URL: ultrastarparser-0.6.5-py3-none-any.whl
- Upload date:
- Size: 10.6 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 | cc4a14b48213b27683d165f84286b2f0aead7e416793cea79cb0be8e9eb3c2ec |
|
MD5 | 5f173c9c48f453cb85864661620c9f56 |
|
BLAKE2b-256 | 7b70fc364e8102efec8f4c2bd5f6b8863cd10a1919308acca461e1286fcf0186 |