Skip to content

Releases: Sharp-API/SharpAPI-Python

v0.3.2 — canonicalize repo URLs

07 May 14:54

Choose a tag to compare

Metadata-only release. Updates the Repository and Changelog URLs in package metadata to match the canonical SharpAPI-Python repo case (was lowercase). No code changes from 0.3.1.

v0.3.1 — nested refs + TeamRef metadata

07 May 14:32

Choose a tag to compare

Bundles the 0.3.0 (nested refs) and 0.3.1 (TeamRef metadata) work into a single published release. 0.3.0 was never tagged; install 0.3.1 to get all of it.

Added

Nested reference objects (was 0.3.0)

Every odds, opportunity, and reference-list row may now carry optional structured ref objects alongside the legacy flat fields. All additive — clients on older API versions just see None and behave identically.

  • New models: TeamRef, SportRef, EntityRef, Team
  • OddsLine, EVOpportunity, ArbitrageOpportunity, MiddleOpportunity, LowHoldOpportunity — gain home, away, sport_ref, league_ref, market_ref, sportsbook_ref
  • ArbitrageLeg gains sportsbook_ref
  • ClosingOddsLine gains market_ref + sportsbook_ref
  • ClosingSnapshot gains home, away, sport_ref, league_ref
  • Sport, League, Sportsbook, Market gain numerical_id
  • Event gains home, away, sport_ref, league_ref

TeamRef metadata (was 0.3.1)

TeamRef and the Team reference shape gain five optional metadata fields:

  • logo — full CDN URL (~93% coverage)
  • city, mascot, conference, division

All default to None. Unmapped rows omit the field rather than emitting null.

Repo / packaging hygiene

  • Add LICENSE (MIT) and SECURITY.md (hello@sharpapi.io)
  • Author email updated support@hello@
  • Tighten the sdist via [tool.hatch.build.targets.sdist] so .github/ workflow YAML no longer ships to PyPI
  • Drop tests/ from the repo (kept locally for development); CI gate is now lint + typecheck across Python 3.10 → 3.13

Compatibility

No existing field was renamed, retyped, or removed. Code on 0.2.x continues to work.

v0.2.5

22 Apr 22:20

Choose a tag to compare

Highlights

Three releases worth of work since v0.2.2 — coverage parity with the REST API, full error-code registry, and Bearer auth.

feat: Bearer token auth

  • New auth_method: Literal['x-api-key', 'bearer'] = 'x-api-key' kwarg on SharpAPI + AsyncSharpAPI
  • auth_method='bearer' sends Authorization: Bearer <key> instead of X-API-Key
  • Useful for IAM/SSO setups and proxies that strip custom headers
  • SSE intentionally unchanged (EventSource can't set headers)

feat: Endpoint coverage parity

  • Odds.closing(event_id, sportsbook=None)GET /odds/closing (Pro+ closing-line snapshots for CLV)
  • Events.markets(event_id)GET /events/{event_id}/markets
  • New Keys namespace: list(), create(name), revoke(key_id), rotate(key_id)/account/keys
  • Sync (SharpAPI) and async (AsyncSharpAPI) parity throughout
  • New models: ClosingSnapshot, ClosingOddsLine, Market, APIKey

fix: Honor SSE retry: hint

  • SSE reconnect honours the server's retry: hint (3s default) for the first 3 attempts
  • Falls back to exponential backoff (anchored on the hint, capped at 30s) after sustained failures
  • Resets backoff after a graceful reconnect

feat: Full error code registry

  • All 19 HTTP + 6 WebSocket-frame error codes from the canonical pkg/errcodes Go package
  • ERROR_CODE_DESCRIPTIONS, ERROR_CODE_TO_EXCEPTION lookup maps
  • canonical_code() helper resolves deprecated aliases (bad_request, invalid_requestvalidation_error)

Compatibility

All additions; existing code keeps working unchanged. Default behaviour (no auth_method arg, etc.) is identical to v0.2.2.

v0.2.2

19 Apr 17:02

Choose a tag to compare

Retry + Python 3.10+ floor

New

  • Sync and async clients now retry transient upstream failures (502/503/504 or connect/read errors) up to 3 times with full-jitter exponential backoff (500ms base → 4s cap). Shields SDK users from brief API-server restart windows. See SHA-1994.

Breaking

  • Dropped Python 3.9 support. 3.9 reached EOL 2025-10. The package had declared 3.9 support but models.py uses PEP 604 union syntax (int | float) which Pydantic evaluates at runtime and which has always failed on 3.9. Requires Python 3.10+.

Internal

  • USER_AGENT bumped to sharpapi-python/0.2.2.

v0.2.1

16 Apr 18:57

Choose a tag to compare

Fixed

  • Removed events.search() — the /api/v1/events/search endpoint is not implemented on the server, so this call always returned a 404. Use events.list(sport=..., league=...) for filtered listings instead. The method will return when the server adds the endpoint.

v0.2.0

21 Mar 16:07

Choose a tag to compare

What's Changed

  • Canonical field names — EVOpportunity model now uses the canonical API field names as attributes:
    • ev_percentev_percentage
    • true_probabilityfair_probability
    • devig_booksharp_book
    • kelly_fractionkelly_percent
  • Backwards compatible — Pydantic AliasChoices accepts both old and new field names from API responses
  • Removed unused import, bumped user agent string