An ID3 parser and serializer for Python 3.
Example Usage
Creating an ID3 tag from scratch
Input:
from id3parse import ID3, ID3TextFrame
id3 = ID3.from_scratch()
id3.add_frame(ID3TextFrame.from_scratch('TIT2', 'Why Don\'t You Get A Job?'))
id3.add_frame(ID3TextFrame.from_scratch('TPE1', 'The Offspring'))
print(id3.serialize())
Output:
b'ID3\x04\x00\x00\x00\x00\x00=TIT2\x00\x00\x00\x1a\x00\x00\x03Why Don\'t You Get A Job?\x00TPE1\x00\x00\x00\x0f\x00\x00\x03The Offspring\x00'
Parsing an ID3 tag
Input:
from id3parse import ID3
id3 = ID3.from_byte_array(b'ID3\x04\x00\x00\x00\x00\x00=TIT2\x00\x00\x00\x1a\x00\x00\x03Why Don\'t You Get A Job?\x00TPE1\x00\x00\x00\x0f\x00\x00\x03The Offspring\x00')
for f in id3.frames:
print(f)
Output:
TIT2: Why Don't You Get A Job? TPE1: The Offspring
Loading and saving an ID3 tag
from id3parse import ID3, ID3TextFrame
id3 = ID3.from_file('01 - The Offspring - Why Dont You Get A Job.mp3')
id3.add_frame(ID3TextFrame.from_scratch('TPE1', 'The Offspring'))
id3.add_frame(ID3TextFrame.from_scratch('TIT2', 'Why Don\'t You Get A Job?'))
id3.to_file()
Querying frames
from id3parse import ID3, ID3TextFrame
id3 = ID3.from_file('01 - The Offspring - Why Dont You Get A Job.mp3')
tpe1 = id3.find_frame_by_name('TPE1') # Returns a frame, fails if more than one
tpe1.text = 'The Offspring' # frame with this name is available
privs = id3.find_frames_by_name('PRIV') # Returns a list of frames
for priv in privs:
print(priv)
id3.to_file()
Metadata
Release files for id3parse 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| id3parse-0.1.1.tar.gz | 4.9 kB | Details |
Release files / id3parse-0.1.1.tar.gz
| Download URL | id3parse-0.1.1.tar.gz |
|---|---|
| Size | 4.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
af62e8d983d728404a63f68cd03cefbbe9523b60b9c200aaf245df17a7f67408
|
|
BLAKE2b-256 checksum How to use checksums |
d9faab128ac6534bd6ab2ecceaa9b71844d2d45245df2f746e82b19020c8fd26
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |