feat(types): nested refs + TeamRef metadata (0.3.0 / 0.3.1)#7
Merged
Conversation
Add structured ref models (TeamRef, SportRef, EntityRef) and a Team reference model, then surface optional home/away/sport_ref/league_ref/ market_ref/sportsbook_ref on every odds, opportunity, and reference row shipping in api-adapters PR #489 + sharp-api-go PR #345. Reference endpoints (sports, leagues, sportsbooks, markets, teams) gain optional numerical_id, and Team adds optional abbreviation. All fields are additive — legacy clients see None. Bumps to 0.3.0 (minor — purely additive, no field renames or removals). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Surfaces five additional optional fields on the TeamRef pydantic model,
sourced from OpticOdds and backfilled into the SharpAPI atlas by
api-adapters PR #499. All five default to None and are additive — older
servers (and 0.3.0 client code) keep working unchanged.
Coverage at the atlas layer: logo ~93%, similar on the rest. The atlas
``nickname`` field is intentionally NOT mirrored because it duplicates
``mascot`` per the seeding convention.
Touched:
src/sharpapi/models.py — TeamRef gains logo/city/mascot/conference/
division (each Optional[str] = None)
tests/test_models.py — TestPhase2cTeamMetadata covers full
population, the legacy/no-metadata path,
and serialization with exclude_none=True
pyproject.toml — bump 0.3.0 → 0.3.1
src/sharpapi/__init__.py — bump __version__
CHANGELOG.md — 0.3.1 entry
Tests: pytest tests/ → 108 passed (was 105 baseline; +3 Phase 2c tests).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Add MIT LICENSE and SECURITY.md (hello@sharpapi.io) - Update author email support@ → hello@ - Scrub OpticOdds attribution and internal phase markers from source comments, tests, and CHANGELOG - Soften "sharp-api-go" / "api-adapters" references to "the SharpAPI server" - Untrack tests/ and add to .gitignore (kept locally for dev); drop the test step from test.yml + publish.yml (now lint+typecheck gate only) - Tighten sdist via [tool.hatch.build.targets.sdist] include/exclude so .github/ workflows no longer ship to PyPI sdist - Tighten .gitignore (.claude/, .DS_Store, .coverage, htmlcov/, .benchmarks/) - Fix pre-existing ruff import-order warning in __init__.py Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Mlaz-code
added a commit
that referenced
this pull request
May 7, 2026
## Summary Two related additions to the type model, both additive and non-breaking: **0.3.0 — nested refs** - New types: `TeamRef`, `SportRef`, `EntityRef`, `Team` - Existing odds + opportunity rows extend with optional `home`, `away`, `sport_ref`, `league_ref`, `market_ref`, `sportsbook_ref` - `ArbitrageLeg` gains `sportsbook_ref`; `ClosingOddsLine` gains `market_ref` + `sportsbook_ref` - Reference rows (`Sport`, `League`, `Sportsbook`, `Market`) gain `numerical_id`; `Team` adds `abbreviation` + `numerical_id` **0.3.1 — TeamRef metadata** - `TeamRef` and the `Team` reference shape gain optional `logo`, `city`, `mascot`, `conference`, `division`. ~93% coverage on `logo`, similar on the rest. All five default to `None`. ## Plus a public-release cleanup pass - Add MIT `LICENSE` and `SECURITY.md` - Untrack `tests/` and add to `.gitignore` (kept locally for dev); CI gate is now lint + typecheck across the 3.10–3.13 matrix - Tighten sdist via `[tool.hatch.build.targets.sdist]` so `.github/` workflows no longer ship to PyPI sdist - Update author email to `hello@sharpapi.io` - Misc internal-comment cleanup ## Compatibility No existing field renamed, retyped, or removed. Code on 0.2.x continues to work. --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two related additions to the type model, both additive and non-breaking:
0.3.0 — nested refs
TeamRef,SportRef,EntityRef,Teamhome,away,sport_ref,league_ref,market_ref,sportsbook_refArbitrageLeggainssportsbook_ref;ClosingOddsLinegainsmarket_ref+sportsbook_refSport,League,Sportsbook,Market) gainnumerical_id;Teamaddsabbreviation+numerical_id0.3.1 — TeamRef metadata
TeamRefand theTeamreference shape gain optionallogo,city,mascot,conference,division. ~93% coverage onlogo, similar on the rest. All five default toNone.Plus a public-release cleanup pass
LICENSEandSECURITY.mdtests/and add to.gitignore(kept locally for dev); CI gate is now lint + typecheck across the 3.10–3.13 matrix[tool.hatch.build.targets.sdist]so.github/workflows no longer ship to PyPI sdisthello@sharpapi.ioCompatibility
No existing field renamed, retyped, or removed. Code on 0.2.x continues to work.