Library to create and modify lrc files.
Project description
pyLRCtool
Library to create and modify lrc files.
Functionality
- parse lrc files and modify them
- create new lrc files
- export to srt file
- import from srt file
- add delay
Installation
git clone https://github.com/varyg1001/pylrctool
cd pylrctool
pip install .
Library usage
from pathlib import Path
import pendulum
from pylrctool import LRCEvent, LRCFile
lrc_file = LRCFile()
file = Path('test.lrc')
file2 = Path('test.srt')
# Both statements below are equivalent
lrc_file.from_file(file)
lrc_file.from_string(file.read_text())
lrc_file.from_srt(file2)
# add new events
event = LRCEvent(
time=pendulum.duration(minutes=0, seconds=29, milliseconds=130),
data="And I ain't gon' kill my vibe",
)
lrc_file.add(event)
# other event types
title = LRCEvent(data="Don't Be Afraid", type=LRCEvent.Type.Title)
author = LRCEvent(data="Azahriah / BLANKS", type=LRCEvent.Type.Author)
length = LRCEvent(data="02:52", type=LRCEvent.Type.Length)
lrc_file.add(title)
lrc_file.add(author)
lrc_file.add(author)
# shift with 1 minute
lrc_file.shift(minutes=1)
# merge lines to create repeat ie. [00:35.06][00:36.06]Don't be afraid
lrc_file.merge_lines()
# saved to out.lrc
output = Path('out.lrc')
lrc_file.dump(output)
# saved to out.scr
output = Path('out.src')
lrc_file.dump_to_srt(output)
# dumps lyrics only
lrc_file.dumps(data_only=True)
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
pylrctool-0.2.0.tar.gz
(18.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
pylrctool-0.2.0-py3-none-any.whl
(19.1 kB
view details)
File details
Details for the file pylrctool-0.2.0.tar.gz.
File metadata
- Download URL: pylrctool-0.2.0.tar.gz
- Upload date:
- Size: 18.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dd472efafc6af2a19a8ecd4a8c89ae8bec39611b0fe9b3fc7ec159e4d424a7c4
|
|
| MD5 |
bb833d7fce3902c324448a102c6a58ce
|
|
| BLAKE2b-256 |
39e9c190e63dc4bc5576fac8bd82ff8fcd46723d93d4d0a7a9c9e4b94e80e1c1
|
File details
Details for the file pylrctool-0.2.0-py3-none-any.whl.
File metadata
- Download URL: pylrctool-0.2.0-py3-none-any.whl
- Upload date:
- Size: 19.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1de172ae241c0cc2d72636387751970abd383379df7b6ba77b9b2a42ede789c4
|
|
| MD5 |
56f96e52faaf391ce3d04d849375fe2a
|
|
| BLAKE2b-256 |
c6d08c291e1b1f9a119f3ab6e929dba43364d4a890c91170b2ac57e91d349b21
|