Client API¶
Public vgmdb clients composing transport + parsers.
AsyncClient
¶
Asynchronous vgmdb client. Shares path logic and parsers with :class:Client.
Construct with a :class:TransportConfig (an :class:AsyncTransport is created internally) or
inject a ready async transport. Exactly one of config/transport is required. Usable as an
async context manager that closes the transport on exit.
Source code in src/vgmdb_client/client/async_client.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | |
aclose()
async
¶
Close the underlying transport.
Source code in src/vgmdb_client/client/async_client.py
77 78 79 | |
from_credentials(credentials, **config_overrides)
classmethod
¶
Build a client from a :class:Credentials pair (initial fill).
Extra keyword arguments are forwarded to :meth:Credentials.to_config as
:class:TransportConfig overrides (e.g. timeout, min_interval, proxy).
Source code in src/vgmdb_client/client/async_client.py
35 36 37 38 39 40 41 42 | |
get_album(album_id)
async
¶
Fetch and parse an album page.
Source code in src/vgmdb_client/client/async_client.py
53 54 55 | |
get_artist(artist_id)
async
¶
Fetch and parse an artist page.
Source code in src/vgmdb_client/client/async_client.py
61 62 63 | |
get_event(event_id)
async
¶
Fetch and parse an event page.
Source code in src/vgmdb_client/client/async_client.py
73 74 75 | |
get_organization(org_id)
async
¶
Fetch and parse an organization page.
Source code in src/vgmdb_client/client/async_client.py
69 70 71 | |
get_product(product_id)
async
¶
Fetch and parse a product page.
Source code in src/vgmdb_client/client/async_client.py
65 66 67 | |
search(query)
async
¶
Fetch and parse a search-results page.
Source code in src/vgmdb_client/client/async_client.py
57 58 59 | |
set_credentials(credentials)
¶
Apply a fresh :class:Credentials pair to the live client (renewal).
Use after a :class:~vgmdb_client.transport.errors.CloudflareChallengeError: re-solve in the
browser, copy a fresh cURL, and swap the pair in without rebuilding the client.
Source code in src/vgmdb_client/client/async_client.py
44 45 46 47 48 49 50 51 | |
Client
¶
Synchronous vgmdb client: fetch + parse album/search pages into M1 models.
Construct with a :class:TransportConfig (a :class:SyncTransport is created internally) or
inject a ready transport (e.g. a stub in tests). Exactly one of config/transport is
required. Usable as a context manager that closes the transport on exit.
Source code in src/vgmdb_client/client/sync_client.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | |
close()
¶
Close the underlying transport.
Source code in src/vgmdb_client/client/sync_client.py
77 78 79 | |
from_credentials(credentials, **config_overrides)
classmethod
¶
Build a client from a :class:Credentials pair (initial fill).
Extra keyword arguments are forwarded to :meth:Credentials.to_config as
:class:TransportConfig overrides (e.g. timeout, min_interval, proxy).
Source code in src/vgmdb_client/client/sync_client.py
35 36 37 38 39 40 41 42 | |
get_album(album_id)
¶
Fetch and parse an album page.
Source code in src/vgmdb_client/client/sync_client.py
53 54 55 | |
get_artist(artist_id)
¶
Fetch and parse an artist page.
Source code in src/vgmdb_client/client/sync_client.py
61 62 63 | |
get_event(event_id)
¶
Fetch and parse an event page.
Source code in src/vgmdb_client/client/sync_client.py
73 74 75 | |
get_organization(org_id)
¶
Fetch and parse an organization page.
Source code in src/vgmdb_client/client/sync_client.py
69 70 71 | |
get_product(product_id)
¶
Fetch and parse a product page.
Source code in src/vgmdb_client/client/sync_client.py
65 66 67 | |
search(query)
¶
Fetch and parse a search-results page.
Source code in src/vgmdb_client/client/sync_client.py
57 58 59 | |
set_credentials(credentials)
¶
Apply a fresh :class:Credentials pair to the live client (renewal).
Use after a :class:~vgmdb_client.transport.errors.CloudflareChallengeError: re-solve in the
browser, copy a fresh cURL, and swap the pair in without rebuilding the client.
Source code in src/vgmdb_client/client/sync_client.py
44 45 46 47 48 49 50 51 | |