A typed, sync + async Python client for vgmdb.net (the video game music database).
Project description
vgmdb-client
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.
- Documentation: https://HOZHENWAI.github.io/vgmdb-client/
- Source: https://github.com/HOZHENWAI/vgmdb-client/
Features
- Sync and async —
ClientandAsyncClientshare the same typed API. - Typed models —
Album,Track,Credit,Artist,Product,Organization,Event, search results — immutable pydantic v2 models. - Cloudflare-aware transport — manual
cf_clearance+User-Agentinjection, 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_curlextracts thecf_clearance+ matchingUser-Agentpair 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, andtenacity.
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
50c23c1bd3fbaa84ad2cbfbec77b1a5cf2ecd977bddf3785e5f78501837f0df6
|
|
| MD5 |
6ffe91df7595fde40d5e32f642beb433
|
|
| BLAKE2b-256 |
a9681da0569518e6fd95ef1237961e3ebc3eb15a8959548ae165da5bd1cd19c1
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
665b7cea175496fb9586029a904604c2631e1343b7119095d2171d5d363fd30d
|
|
| MD5 |
2efe18663d3061d902ba41d57e8b4c27
|
|
| BLAKE2b-256 |
8d399a2a24726ec25e02042f7485e8f6384e10987d50af19937525ed7a0af6f8
|