Skip to content

Commit 3a33100

Browse files
paperclip-resolver[bot]claude
andcommitted
feat: add optional team_side + market_segment to odds/EV/closing models (#76, #689)
OddsLine, EVOpportunity, ClosingOddsLine each gain optional team_side ("home"|"away"|"draw") + market_segment ("full_game","1st_half",...). Surfaces the structured axes the API now emits (sharp-api-go #76 Phase C / #689). Additive, default None. Bump 0.4.0 → 0.4.1. Type: feat Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 9ca991c commit 3a33100

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.4.1 — 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.4.0 — 2026-06-02
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.4.0"
7+
version = "0.4.1"
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
@@ -293,6 +299,9 @@ class EVOpportunity(BaseModel):
293299
detected_at: str | None = None
294300
external_event_id: str | None = None
295301
selection_id: str | None = None
302+
# Structured side/segment axes (issue #76 / #689), additive + optional.
303+
team_side: str | None = None
304+
market_segment: str | None = None
296305
# Optional structured refs (additive, non-breaking).
297306
home: TeamRef | None = None
298307
away: TeamRef | None = None
@@ -572,6 +581,9 @@ class ClosingOddsLine(BaseModel):
572581
market_type: str
573582
selection: str
574583
selection_type: str | None = None
584+
# Structured side/segment axes (issue #76 / #689), additive + optional.
585+
team_side: str | None = None
586+
market_segment: str | None = None
575587
odds_american: int | float
576588
odds_decimal: float
577589
line: float | None = None

0 commit comments

Comments
 (0)