Skip to content

feat(types): nested refs + TeamRef metadata (0.3.0 / 0.3.1)#7

Merged
Mlaz-code merged 3 commits into
mainfrom
feat/team-metadata-phase-2c
May 7, 2026
Merged

feat(types): nested refs + TeamRef metadata (0.3.0 / 0.3.1)#7
Mlaz-code merged 3 commits into
mainfrom
feat/team-metadata-phase-2c

Conversation

@Mlaz-code
Copy link
Copy Markdown
Contributor

@Mlaz-code Mlaz-code commented 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.

Mlaz-code and others added 3 commits May 6, 2026 22:02
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 Mlaz-code changed the title feat(types): TeamRef logo/city/mascot/conference/division (Phase 2c) feat(types): nested refs + TeamRef metadata (0.3.0 / 0.3.1) May 7, 2026
@Mlaz-code Mlaz-code marked this pull request as ready for review May 7, 2026 14:22
@Mlaz-code Mlaz-code merged commit 9c2e8d5 into main May 7, 2026
@Mlaz-code Mlaz-code deleted the feat/team-metadata-phase-2c branch May 7, 2026 14:22
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant