goblin-wg
Wargaming API client and CLI toolkit for Python.
Dynamically generates typed methods from the live WG API specification at runtime, with automatic type stub generation (client.pyi) so your editor knows about every endpoint without guessing.
Exposes multiple interfaces for the WG developer API as seen here: Official WarGaming API Reference
Features
- Dynamic API methods — all 28+ WoWS endpoints are bound automatically from the live
wows/spec. - Auto-generated type stubs —
client.pyiis generated on first use and refreshed whenever the spec changes. Works with (based)Pyright, mypy, and Pylance out of the box. - Sensible cache defaults — spec and stubs are stored in your platform's standard cache directory (
~/.cache/wg/wows,%LOCALAPPDATA%/wg/wows, or$XDG_CACHE_HOME/wg/wows) or a custom location. - Minimal dependencies — only
aiohttprequired at runtime. - PEP 561 compliant — ships
py.typed.
Installation
Plebians, knuckle-draggers use:
pip install goblin-wg
Sigmas, with uv:
uv add goblin-wg
Usage
Python
import asyncio
import wg.wows as wows
async def main():
client = wows.WargamingAPIClient(application_id="YOUR_WG_APP_ID")
# All API methods are dynamically bound with full IDE type hints
players = await client.account_list(region="na", search="JesusLovesYouExceptSubs")
info = await client.account_info(region="na", account_id=123456789)
clan = await client.clans_info(region="na", clan_id=674206767, extra="members")
asyncio.run(main())
Custom storage path (e.g., within a project):
client = wows.WargamingAPIClient(
application_id="YOUR_WG_APP_ID",
storage_path="/path/to/your/cache",
)
AttrDict
All API responses are returned as AttrDict — a dict subclass with dot-access for convenience:
players = await client.account_list(region="na", search="goblin")
for p in players:
print(p.nickname, p.account_id) # dot access works
CLI
The wg CLI is registered as a project script when installed:
# Show status of cached spec and stubs
wg wows info
# Generate or regenerate type stubs
wg wows generate-stubs
wg wows generate-stubs --force # force even if stubs already exist
# Fetch the latest Wargaming API spec (and optionally regenerate stubs)
wg wows fetch-spec
wg wows fetch-spec --generate-stubs
# Shortcut: standalone stub generation (useful in CI or post-install hooks)
wg-stubgen --force
wg-stubgen --output /path/to/custom.pyi
Auto-setup on first run
If you install goblin-wg into a new project and run wg without arguments, it will automatically detect missing stubs and run generation for you:
$ wg
Initial setup: WoWS type stubs not found. Autorunning type stub generation...
WoWS type stubs generated at: .../wg/wows/client.pyi
Versioning
goblin-wg uses Semantic Versioning.
The wg.wows submodule additionally tracks the WoWS game version it was
spec-built against:
import wg
import wg.wows
print(wg.__version__) # e.g. "1.0.0" — package version
print(wg.wows.__version__) # e.g. "15.8.0" — WoWS game version at spec build time
Regional Base URLs
All WoWS API endpoints use the pattern {base_url}/wows/{method}/.
| Region | Base URL | Code |
|---|---|---|
| North America | https://api.worldofwarships.com |
"na" |
| Europe | https://api.worldofwarships.eu |
"eu" |
| Asia | https://api.worldofwarships.asia |
"asia" |
| Russia (👀) | https://api.worldofwarships.ru |
"ru" |
Every request requires a application_id. Private endpoints additionally require an access_token.
Development & Contributing
See notes.md for architecture notes, endpoint coverage status, known gaps, and contribution guidelines.
License
MIT — see LICENSE for details.
Release files for goblin-wg 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| goblin_wg-1.0.0.tar.gz | 43.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| goblin_wg-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 90.6 kB
Release files / goblin_wg-1.0.0.tar.gz
| Download URL | goblin_wg-1.0.0.tar.gz |
|---|---|
| Size | 43.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d1b160d6817cefbaed9b2bad672dd538ccc4b39677e4712e230cdb398b00b4c1
|
|
BLAKE2b-256 checksum How to use checksums |
724d7c4390415e4646de1de4d1af2f7652c37f3e667666159d0f5996e2e41a29
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.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 Sep 27, 2026.
Transparency logRelease files / goblin_wg-1.0.0-py3-none-any.whl
| Download URL | goblin_wg-1.0.0-py3-none-any.whl |
|---|---|
| Size | 47.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ee5ea9332584114f9d8b9da7fa4e919e05a1b0d2a95853f3965ff88cda2e937c
|
|
BLAKE2b-256 checksum How to use checksums |
4780125a3f85f0bf2d92a812f4a7ec4bf2a045320f9955ed005a825e84955495
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.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 Sep 27, 2026.
Transparency log