Skip to main content

pymetallum

An interactive terminal browser for Metal Archives.

Search bands, albums, artists, songs, and labels — then navigate between them with a menu-driven UI. Band logos and album covers display inline on supported terminals.

Install

Requires Python 3.12+.

Terminal CLI

uv tool install pymetallum
# or
pip install pymetallum

Discord bot

uv tool install 'pymetallum[discord]'
# or
pip install 'pymetallum[discord]'

Create a bot application at the Discord Developer Portal, enable the bot scope with Send Messages and Use Slash Commands permissions, then invite it to your server with the generated OAuth2 URL.

Set your bot token and run:

export DISCORD_TOKEN=your-bot-token
metallum-discord

Or put DISCORD_TOKEN=your-bot-token in a .env file in the current directory and run metallum-discord with no environment variable set.

Use --guild GUILD_ID to sync slash commands instantly to a specific server (global sync can take up to an hour).

Slash commands (all under /metallum):

Command Description
/metallum band <query> Search bands (with optional genre, country, year, status, themes, location, label filters)
/metallum album <query> Search albums (with optional genre, country, year, location, label filters)
/metallum artist <query> Search artists
/metallum song <query> Search songs (with optional genre, lyrics filters)
/metallum label <query> Search labels
/metallum search <query> Search all categories
/metallum random Show a random band
/metallum recent Recently added/modified bands or labels
/metallum upcoming Upcoming album releases

Development

git clone https://github.com/gabriel-jung/pymetallum.git
cd pymetallum
uv sync  # installs dev deps + [discord] extra

Usage

metallum Summoning                  # search across all categories
metallum --band Summoning           # bands only
metallum --album "Minas Morgul"     # albums only
metallum --artist "Protector"       # artists only
metallum --song Lugburz             # songs only
metallum --label "Napalm Records"   # labels only

By default, exact name matches are shown first. Use -s to see all results:

metallum --band Summoning -s

Advanced search (filters)

Filters can be combined and work with --band, --album, and --song:

# bands
metallum --genre "black metal"
metallum --band --country norway --status active
metallum --band --genre thrash --themes war --year 1985-1992
metallum --band --location "Bay Area" --label-name "Megaforce"

# albums
metallum --album --genre doom --year 1990-1995
metallum --album --country finland

# songs
metallum --song --lyrics "ring of power"
metallum --song --genre "death metal"

Available filters by entity type:

Filter --band --album --song
--genre x x x
--country x x
--year x x
--status x
--themes x
--location x x
--label-name x x
--lyrics x

--country accepts ISO codes (NO, FI, US) or full names (Norway, Finland). --status accepts: active, split-up, on hold, changed name, unknown. --year accepts a single year (1995) or a range (1990-1995).

Interactive navigation

After selecting a result, you enter an interactive browser. A numbered menu lets you explore sections — discography, members, tracklist, reviews, similar artists, lyrics, and more. Select any linked entity (a band member, an album, a label) to navigate to it. Press 0 to go back.

Browse recent & upcoming

# recently added/modified bands (this month)
metallum --recent
metallum --new                       # only newly created
metallum --modified                  # only recently modified

# labels
metallum --label --recent
metallum --label --new

# specific month
metallum --new --month 2026-01

# date range (fetches full months then filters — slow for wide ranges)
metallum --new --from 2026-03-01
metallum --modified --from 2026-02-15 --to 2026-03-15

# upcoming album releases
metallum --upcoming
metallum --upcoming --from 2026-04-01 --to 2026-06-01

Random band

metallum --random

Output modes

metallum --band Summoning --full    # print all sections, no menu
metallum --band Summoning --json    # dump full entity data as JSON
metallum --upcoming --json          # works with any mode
metallum -v ...                     # enable debug logging

When a name has several exact matches, --full and --json still ask which one you mean; add a filter or use the entity's URL to skip the prompt. With --json, stdout carries only JSON ([] when nothing matched) and messages go to stderr. The exit status is 0 on success (including "no results"), 1 when a request to Metal Archives failed or the entry no longer exists, 2 for invalid flags, and 130 when a --json run is interrupted. With filters, --json returns every match; --limit N stops after N.

Terminal images

Band logos and album covers render inline on terminals that support the iTerm2 or Kitty image protocol (iTerm2, Kitty, WezTerm, Mintty).

Library

All data is returned as plain dicts, for use in scripts, pipelines, or other tools.

from pymetallum.core import MetalArchivesClient, BandAPI, AlbumAPI, ArtistAPI, SongAPI, LabelAPI

with MetalArchivesClient() as client:
    bands = BandAPI(client)

    # search and fetch
    results = bands.search("Summoning")
    band = bands.get(results[0]["url"])
    band = bands.get(results[0]["url"], full=True)  # includes description & similar artists

    # advanced search with filters
    results, total = bands.advanced_search(genre="black metal", country="AT")  # one page
    everything = bands.advanced_search_all(genre="black metal", country="AT")

    # random band
    band = bands.get_random()

    # recent entries
    new_bands = bands.fetch_recently_created("2026-03")
    modified_bands = bands.fetch_recently_modified("2026-03")
    page, total = bands.fetch_recent_page("created", "2026-03", start=0, count=25)

    # albums & upcoming releases
    albums = AlbumAPI(client)
    album = albums.get(band["discography"][0]["url"])
    upcoming = albums.fetch_upcoming(from_date="2026-04-01", to_date="2026-06-01")

    # artists, songs, labels
    artists = ArtistAPI(client)
    songs = SongAPI(client)
    labels = LabelAPI(client)
    new_labels = labels.fetch_recently_created("2026-03")

    # download images
    client.download_image(band["logo_url"], output_dir="./images/")

Errors

get() raises NotFoundError when the page no longer exists. Any other failed request raises FetchError (timeouts, server errors after one retry, a body that should be JSON but is not), and its subclass BlockedError while Metal Archives refuses requests (a Cloudflare 403 or a 429, then a cooldown of up to two minutes during which requests fail without touching the network). Searches, listings and paged crawls raise too, so a failure never reads as an empty or shortened result. Only image bytes are skipped quietly when their download fails.

from pymetallum.core import BlockedError, FetchError, NotFoundError

try:
    band = bands.get(url)
except NotFoundError:
    ...  # deleted: stop retrying
except BlockedError:
    ...  # back off for a few minutes
except FetchError:
    ...  # transient: retry later

Bulk callers that do not render images should pass with_media=False to get(): the image download costs a full rate-limited request per entity.

License

MIT

Metadata

Release files for pymetallum 0.6.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pymetallum 0.6.1
File Size Uploaded Provenance Actions
pymetallum-0.6.1.tar.gz 50.1 kB With provenance Details for pymetallum-0.6.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pymetallum 0.6.1
File Interpreter ABI Platform Actions
pymetallum-0.6.1-py3-none-any.whl Python 3 none any Details for pymetallum-0.6.1-py3-none-any.whl

Total release size: 104.4 kB

Release files / pymetallum-0.6.1.tar.gz

Download URL pymetallum-0.6.1.tar.gz
Size 50.1 kB
Tags Source
SHA-256 checksum
How to use checksums
cd3a10e054c1309cc0e9272b07821db32430f87e3f0de804561f78d54f85129e
BLAKE2b-256 checksum
How to use checksums
1992d4f70d70556acffae13ed6effda1408dbb92d81638906455639ae0698884
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

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 Nov 12, 2026.

Transparency log

Release files / pymetallum-0.6.1-py3-none-any.whl

Download URL pymetallum-0.6.1-py3-none-any.whl
Size 54.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
57abfb775edbbbeb60909a50cb2fe31f9a3afb4737c3d1d9f7bda5cb38a01062
BLAKE2b-256 checksum
How to use checksums
e4238597cc116b2aa7ab36a55f85e642970d82379d4f2609a9697789dd41306c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

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 Nov 12, 2026.

Transparency log

Security for pymetallum 0.6.1

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.

Select from 2 files

Attestation for pymetallum-0.6.1.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 Nov 12, 2026.

Transparency log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page