Muzlib
Muzlib is a Python script that allows you to create your own music library. Music is downloaded from YouTube, and music tags are constructed using data from YouTube, Lrclib, NetEase.
🖥️🖱️ For GUI install muzlib-desktop
Instalation
Arch Linux [AUR]
You can install python-muzlib from AUR using your favorite AUR helper, for example:
yay -S python-muzlib
From PyPI
Ensure that you have installed FFmpeg.
Using uv
You can run muzlib without installation directly from the command line using uvx, which will handle dependencies and virtual environments for you:
uvx --from muzlib muzlib-cli
Using pip
You can install muzlib using pip in a virtual environment:
python -m venv .venv
source .venv/bin/activate
pip install muzlib
Usage
Muzlib can be run directly from the command line. When launched without arguments, it starts an interactive prompt guiding you through the download process. You can also pass arguments to skip prompts entirely.
muzlib-cli [-h] [-l LIBRARY_PATH] [-d {album,artist,song}]
[--artist ARTIST] [--album ALBUM] [--song SONG]
[--format FORMAT] [--non_interactive]
Arguments
| Argument | Short | Description |
|---|---|---|
--help |
-h |
Show help message and exit. |
--library_path PATH |
-l |
Root directory to save downloaded music. Defaults to your OS standard Music folder. |
--audio_format FORMAT |
-a |
Target audio format (e.g., opus, m4a, mp3, ). Defaults to opus. |
--download_type {album,artist,song} |
-d |
Scope of the download: artist (full discography), album (specific release), or song (single track). |
--artist ARTIST |
Target artist's name. Highly recommended for all download types to ensure accurate search results. | |
--album ALBUM |
Target album's title. Use alongside --artist when --download_type is album. |
|
--song SONG |
Target song's title. Use alongside --artist when --download_type is song. |
|
--non_interactive |
Bypass all user prompts and automatically download the top search result. Requires --download_type to be set. |
Examples
Interactive mode
launches a menu to guide you through the download
muzlib-cli
Download an artist's full discography non-interactively
muzlib-cli -d artist --artist "Ludwig Göransson" --non_interactive
Download a specific album
muzlib-cli -d album --artist "Ludwig Göransson" --album "Oppenheimer" --non_interactive
Download a single song into a custom library folder
muzlib-cli -l ~/Music -d song --artist "Ludwig Göransson" --song "Can You Hear The Music" --format "opus" --non_interactive
Available classes
There is only one (for now) class that can be used:
Muzlib(library_path: str, audio_format="opus", skip_downloaded=False): library class that uses YouTube Music metadata
Available methods
Backup library
Muzlib.backup_library() -> str
This function creates backup of library (even with user-changed tags).
Creates file .muzlib/muzlib_backup_***.json and returns path to it.
Restore library
This function downloads track and set metadata from bacup file.
Muzlib.backup_library(backup_filepath: str)
backup_filepath: path of the file created byMuzlib.backup_library().
Troubleshooting
Metadata
Release files for muzlib 0.4.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| muzlib-0.4.2.tar.gz | 50.9 kB | With provenance | Details for muzlib-0.4.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| muzlib-0.4.2-py3-none-any.whl | Python 3 | none | any | Details for muzlib-0.4.2-py3-none-any.whl |
Total release size: 98.5 kB
Release files / muzlib-0.4.2.tar.gz
| Download URL | muzlib-0.4.2.tar.gz |
|---|---|
| Size | 50.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
eab82555c8e9243ac0f4a4421874d530cce98905ee5b296d40d02156a9351875
|
|
BLAKE2b-256 checksum How to use checksums |
6874398117d72b7e23f0a72a0d552330ecb89da8e88bad3547c1db665900a2be
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.
Transparency logRelease files / muzlib-0.4.2-py3-none-any.whl
| Download URL | muzlib-0.4.2-py3-none-any.whl |
|---|---|
| Size | 47.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7ea4a29f6571d2d77c704c2b1039cdf2035a09f0a260fefa872ba0bd8c4a8d06
|
|
BLAKE2b-256 checksum How to use checksums |
2b549ca54751f573ffde1ab000ea15749605e4de0674064d1a6443ee18ff9004
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.
Transparency logSecurity for muzlib 0.4.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for muzlib-0.4.2.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.