Skip to main content

A typed, sync + async Python client for vgmdb.net (the video game music database).

Project description

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.

Project details


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.0.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.0-py3-none-any.whl (46.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: vgmdb_client-1.0.0.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.0.tar.gz
Algorithm Hash digest
SHA256 50c23c1bd3fbaa84ad2cbfbec77b1a5cf2ecd977bddf3785e5f78501837f0df6
MD5 6ffe91df7595fde40d5e32f642beb433
BLAKE2b-256 a9681da0569518e6fd95ef1237961e3ebc3eb15a8959548ae165da5bd1cd19c1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vgmdb_client-1.0.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 665b7cea175496fb9586029a904604c2631e1343b7119095d2171d5d363fd30d
MD5 2efe18663d3061d902ba41d57e8b4c27
BLAKE2b-256 8d399a2a24726ec25e02042f7485e8f6384e10987d50af19937525ed7a0af6f8

See more details on using hashes here.

Supported by

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