Skip to main content

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

Python License: MIT


Features

  • Dynamic API methods — all 28+ WoWS endpoints are bound automatically from the live wows/ spec.
  • Auto-generated type stubs — client.pyi is 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 aiohttp required 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.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for goblin-wg 1.0.1
File Size Uploaded
goblin_wg-1.0.1.tar.gz 44.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for goblin-wg 1.0.1
File Interpreter ABI Platform
goblin_wg-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 93.0 kB

Release files / goblin_wg-1.0.1.tar.gz

Download URL goblin_wg-1.0.1.tar.gz
Size 44.8 kB
Tags Source
SHA-256 checksum
How to use checksums
e5b7dc58329e8d88d85854beb19a5e5d606ad259b201dda1423d55ae7cd20c9f
BLAKE2b-256 checksum
How to use checksums
68622057a4cb4c804672a821ca0b1b5827cb94a3a0e8e8ea8107d0df83638aea
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 28, 2026.

Transparency log

Release files / goblin_wg-1.0.1-py3-none-any.whl

Download URL goblin_wg-1.0.1-py3-none-any.whl
Size 48.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
457665aa6d963e3e5208f05b922d2d41f72d7f7a922c24c78888954fe342f5a8
BLAKE2b-256 checksum
How to use checksums
79d6fd2e25620652f4e9c5664f61e3d28b69c21e832c7196b9c14c0206120c1f
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 28, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page