Skip to content

v5.0.0 — Python SDK

Latest

Choose a tag to compare

@felipeall felipeall released this 12 Oct 16:37
2194976

Transfermarkt API 5.0.0 introduces an installable async Python SDK alongside the HTTP service.

Added

  • Installable async Python SDK: from transfermarkt_api import Transfermarkt, with typed response models for every data endpoint, async context management, explicit configuration, and caller-supplied httpx transports.
  • CacheConfig for per-client cache settings; cache=None disables ordinary and reference caches.
  • Public SDK exceptions distinguish unknown entities, blocked requests, timeouts, invalid upstream responses and unavailable endpoints. Custom transport exceptions and cancellation propagate unchanged.
  • Transport timestamp metadata and recording/replay examples preserve updatedAt when reassembling stored upstream responses. Fan-out cancels and awaits sibling work before propagating failures.

Changed

  • The HTTP service consumes the SDK while retaining its routes, response models, error statuses, environment settings and rate limits. Schemas, services and upstream internals moved out of app; the supported library API is the facade, models, exceptions and cache configuration.
  • Core installations require only httpx, Pydantic and cachetools, with compatible dependency ranges. Install the server extra for FastAPI, uvicorn, rate limiting and environment settings. The existing app.main:app server entry point is retained.

The wheel installs only transfermarkt_api; the HTTP server remains available from source and Docker. The SDK requires Python 3.12 or 3.13.

Validation: 218 offline tests, package-wide typing, clean distribution installation, and live CI checks passed.