Skip to content

Commit 362b102

Browse files
paperclip-resolver[bot]claude
andcommitted
feat: add optional team_side + market_segment to odds/EV/closing models (#76, #689)
Surfaces the structured side + segment axes the API now emits (sharp-api-go #76 Phase C / #689). OddsLine, EVOpportunity, and ClosingOddsLine each gain optional team_side ("home"|"away"|"draw") and market_segment ("full_game", "1st_half", ...). Additive, default None — existing code unaffected; the API keeps emitting compound selection_type for back-compat. Bump 0.3.3 → 0.3.4. Type: feat Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 78d805a commit 362b102

3 files changed

Lines changed: 26 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,19 @@
22

33
All notable changes to the `sharpapi` Python SDK are documented here.
44

5+
## 0.3.4 — 2026-06-02
6+
7+
### Added — structured `team_side` + `market_segment` (issue #76 / #689)
8+
9+
- `OddsLine`, `EVOpportunity`, and `ClosingOddsLine` gain two optional fields:
10+
- `team_side` — the raw structured side (`"home"` | `"away"` | `"draw"`)
11+
decomposed out of the compound `selection_type` vocabulary. Prefer this over
12+
parsing compound prefixes like `"home_over"`.
13+
- `market_segment` — the canonical contest slice (`"full_game"`, `"1st_half"`,
14+
`"1st_5_innings"`, ...).
15+
- Both are additive and default to `None`; existing code is unaffected. The API
16+
continues to emit the compound `selection_type` for back-compat.
17+
518
## 0.3.2 — 2026-05-07
619

720
### Changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "sharpapi"
7-
version = "0.3.3"
7+
version = "0.3.4"
88
description = "Official Python SDK for the SharpAPI real-time sports betting odds API"
99
readme = "README.md"
1010
license = "MIT"

src/sharpapi/models.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,12 @@ class OddsLine(BaseModel):
214214
market_type: str
215215
selection: str
216216
selection_type: str | None = None
217+
# Structured side/segment axes (issue #76 / #689). team_side is the raw
218+
# "home"|"away"|"draw" decomposed out of the compound selection_type vocab;
219+
# market_segment is the contest slice ("full_game", "1st_half", ...). Both
220+
# optional + additive — absent on rows the adapter didn't stamp.
221+
team_side: str | None = None
222+
market_segment: str | None = None
217223
odds_american: int | float
218224
odds_decimal: float
219225
probability: float
@@ -286,6 +292,9 @@ class EVOpportunity(BaseModel):
286292
detected_at: str | None = None
287293
external_event_id: str | None = None
288294
selection_id: str | None = None
295+
# Structured side/segment axes (issue #76 / #689), additive + optional.
296+
team_side: str | None = None
297+
market_segment: str | None = None
289298
# Optional structured refs (additive, non-breaking).
290299
home: TeamRef | None = None
291300
away: TeamRef | None = None
@@ -563,6 +572,9 @@ class ClosingOddsLine(BaseModel):
563572
market_type: str
564573
selection: str
565574
selection_type: str | None = None
575+
# Structured side/segment axes (issue #76 / #689), additive + optional.
576+
team_side: str | None = None
577+
market_segment: str | None = None
566578
odds_american: int | float
567579
odds_decimal: float
568580
line: float | None = None

0 commit comments

Comments
 (0)