Skip to main content

vgmdb-client

Release Build status codecov License

A typed, sync + async Python client for vgmdb.net — the community database of video-game and anime music. It fetches and parses albums, artists, products, organizations, and events into validated pydantic models, with its own clean-room HTML parsers.

Features

  • Sync and asyncClient and AsyncClient share the same typed API.
  • Typed modelsAlbum, Track, Credit, Artist, Product, Organization, Event, search results — immutable pydantic v2 models.
  • Cloudflare-aware transport — manual cf_clearance + User-Agent injection, typed errors that distinguish a Cloudflare challenge from a real 404, retries, and a politeness throttle.
  • Auth helper — paste a browser "Copy as cURL" and Credentials.from_curl extracts the cf_clearance + matching User-Agent pair for you. (It assists with the token; it does not defeat the Cloudflare challenge — you solve that in your own browser.)
  • Optional enrichment — pluggable backends (deterministic rule-based, or an OpenAI-compatible LLM endpoint) to extract per-track credits from freeform album notes.
  • No heavy dependencies — just httpx, pydantic, lxml, and tenacity.

Installation

pip install vgmdb-client

Quickstart

vgmdb.net is behind Cloudflare, so a request needs a valid cf_clearance cookie paired with the exact User-Agent it was issued for. Solve the challenge once in your browser, open devtools, copy any request to vgmdb.net as cURL (bash), and hand it to the client:

from vgmdb_client import Client
from vgmdb_client.auth import Credentials

curl = """curl 'https://vgmdb.net/album/4' \\
  -H 'user-agent: Mozilla/5.0 ...' \\
  -H 'cookie: cf_clearance=<your-token>; ...'"""

with Client.from_credentials(Credentials.from_curl(curl)) as client:
    album = client.get_album(4)
    print(album.titles.default, album.release_date)

    results = client.search("final fantasy")
    for hit in results.albums[:5]:
        print(hit.catalog, hit.titles.default)

The async client mirrors it:

import asyncio
from vgmdb_client import AsyncClient
from vgmdb_client.auth import Credentials

async def main() -> None:
    async with AsyncClient.from_credentials(Credentials.from_curl(curl)) as client:
        album = await client.get_album(4)
        print(album.titles.default)

asyncio.run(main())

When a token goes stale you'll get a CloudflareChallengeError; grab a fresh cURL and re-apply it without rebuilding the client:

from vgmdb_client.transport.errors import CloudflareChallengeError

try:
    album = client.get_album(4)
except CloudflareChallengeError:
    client.set_credentials(Credentials.from_curl(fresh_curl))
    album = client.get_album(4)

See the documentation for the full API, authentication, entities, and enrichment guides.

Attribution & use

Data comes from vgmdb.net and its contributors. This is an unofficial client; please use it responsibly — keep the politeness throttle enabled and respect vgmdb.net's terms.

License

MIT — see LICENSE.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vgmdb_client-1.0.1.tar.gz (650.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vgmdb_client-1.0.1-py3-none-any.whl (46.9 kB view details)

Uploaded Python 3

File details

Details for the file vgmdb_client-1.0.1.tar.gz.

File metadata

  • Download URL: vgmdb_client-1.0.1.tar.gz
  • Upload date:
  • Size: 650.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for vgmdb_client-1.0.1.tar.gz
Algorithm Hash digest
SHA256 0563878b4e44e4345c710829494208fb1b44d69d678eef77d06a03f0ca934fa5
MD5 ef696b47f2634db41922df9ca10d6860
BLAKE2b-256 2b1c31e520762d7530e81a1d2aa20ca66694196e44dd36e5434ef3f8b7491b8a

See more details on using hashes here.

File details

Details for the file vgmdb_client-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: vgmdb_client-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 46.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for vgmdb_client-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b98a3284a55d9256b44b2cb1797d68f1fd7bb3969d84d1f2fe0e9608dbbd8c7d
MD5 7e9d195e6b5ee413e1ffa39e6831d90a
BLAKE2b-256 d49645ee307998621fa50e74129b9355af494d9942c47b23f4cd8d276b5a0208

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 files

1.0.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page