2025-03-13 17:27:22 +01:00
|
|
|
# SmallTag
|
|
|
|
|
2025-03-30 19:10:55 +02:00
|
|
|
A module that extends [TinyTag](https://github.com/tinytag/tinytag)'s capabilities by also writing tags.
|
2025-03-15 17:18:24 +01:00
|
|
|
|
|
|
|
### Features
|
|
|
|
|
2025-03-30 18:40:34 +02:00
|
|
|
| Feature | Details | State |
|
|
|
|
|--------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------|
|
|
|
|
| ID3 Writing | <input type="checkbox" disabled checked> Strings<br><input type="checkbox" disabled checked> Integers<br><input type="checkbox" disabled checked> Links<br><input type="checkbox" disabled> Images | <input type="checkbox" disabled> Partially Implemented |
|
|
|
|
| Ogg Vorbis Writing | <input type="checkbox" disabled checked> Strings<br><input type="checkbox" disabled checked> Integers<br><input type="checkbox" disabled checked> Links<br><input type="checkbox" disabled> Images | <input type="checkbox" disabled> Partially Implemented |
|
2025-03-15 17:18:24 +01:00
|
|
|
|
2025-03-30 18:51:02 +02:00
|
|
|
## Installation
|
|
|
|
|
|
|
|
Simply let pip install the package:
|
|
|
|
|
|
|
|
``` bash
|
|
|
|
pip install smalltag@git+https://teapot.informationsanarchistik.de/Wobbl/SmallTag.git
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
### SmallTag As A Dependency
|
|
|
|
|
|
|
|
If you are working on a project that uses SmallTag,
|
|
|
|
the line in your requirements.txt that corresponds to SmallTag should contain this:
|
|
|
|
|
|
|
|
```
|
|
|
|
smalltag @ git+https://teapot.informationsanarchistik.de/Wobbl/SmallTag.git#egg=smalltag
|
|
|
|
```
|
|
|
|
|
|
|
|
|
2025-03-15 17:18:24 +01:00
|
|
|
## Usage
|
|
|
|
|
|
|
|
> [!CAUTION]
|
|
|
|
> Please note that this module is still in development and could corrupt the audio file.
|
|
|
|
|
|
|
|
Reading works in exactly the same way as with TinyTag. \
|
|
|
|
Example:
|
|
|
|
|
|
|
|
```Python3
|
|
|
|
from smalltag import SmallTag
|
|
|
|
|
|
|
|
tag = SmallTag.get("test.mp3")
|
|
|
|
|
|
|
|
print(tag.title)
|
|
|
|
# Example Output: Test
|
|
|
|
```
|
|
|
|
|
|
|
|
But this module also adds support for writing metadata.
|
|
|
|
Just use the `write()`-function on a loaded tag to write the metadata to the file. \
|
|
|
|
Example:
|
|
|
|
|
|
|
|
```Python3
|
|
|
|
from smalltag import SmallTag
|
|
|
|
|
|
|
|
tag = SmallTag.get("test.mp3")
|
|
|
|
|
|
|
|
print(tag.title)
|
|
|
|
# Example Output: Test
|
|
|
|
|
|
|
|
tag.title = "Another Test"
|
|
|
|
|
|
|
|
tag.write()
|
|
|
|
```
|
|
|
|
|
|
|
|
When you then load the metadata again, you will see that the title has changed:
|
|
|
|
|
|
|
|
```Python3
|
|
|
|
from smalltag import SmallTag
|
|
|
|
|
|
|
|
tag = SmallTag.get("test.mp3")
|
|
|
|
|
|
|
|
print(tag.title)
|
|
|
|
# Example Output: Another Test
|
|
|
|
```
|