Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
a66e367
feat: add shared parsers for team, people, and schedule responses
Mattsface Aug 13, 2026
cab2a9a
fix: pass full MLB response bodies into shared parsers
Mattsface Aug 13, 2026
13d71ef
fix: parse single-resource responses from MLB envelopes
Mattsface Aug 13, 2026
ddb0895
fix: updated the get_person and get_schedule methods
Mattsface Aug 13, 2026
59cdebd
fix: updated get_teams and get_people to use the parsers correctly
Mattsface Aug 13, 2026
296147a
Merge pull request #310 from zero-sum-seattle/feature/299-shared-resp…
Mattsface Aug 13, 2026
9171b60
build: add optional HTTPX async dependency
Mattsface Aug 13, 2026
e798ba7
Merge pull request #311 from zero-sum-seattle/feature/300-async-packa…
Mattsface Aug 13, 2026
b33c5b5
feat: add asynchronous MLB data adapter
Mattsface Aug 14, 2026
e8f78b8
fix: use shared HTTP helpers in data adapters
Mattsface Aug 14, 2026
a93b70e
fix: preserve HTTP errors when context extraction fails
Mattsface Aug 14, 2026
73054d1
feat: add bounded retry-with-backoff to AsyncMlbDataAdapter
Mattsface Aug 16, 2026
3a340d8
feat: add per-error-kind retry budgets and non-blocking backoff tests
Mattsface Aug 17, 2026
09a87c1
test: cover JSON data, aclose lifecycle, timeout translation, and con…
Mattsface Aug 17, 2026
e138c24
feat: send package User-Agent from library-owned async clients
claude Aug 17, 2026
0d713f1
fix: finish async adapter retry and test cleanup
claude Aug 18, 2026
edcfdc8
fix: expose async adapter behind optional dependency boundary
claude Aug 18, 2026
4413a62
test: align async adapter public API contract
claude Aug 18, 2026
b942a90
test: allow suite collection without async extra
claude Aug 18, 2026
56992ea
Merge pull request #314 from zero-sum-seattle/feature/301-async-data-…
Mattsface Aug 18, 2026
1f71168
ci: exercise async coverage in v1.1
Mattsface Aug 18, 2026
4580e04
Merge pull request #315 from zero-sum-seattle/ci/312-async-test-coverage
Mattsface Aug 18, 2026
786c9e6
ci: add Claude workflows to release/1.1.0
claude Aug 19, 2026
b9e050b
Merge pull request #317 from zero-sum-seattle/chore/add-claude-workfl…
Mattsface Aug 19, 2026
987f7eb
test: add async transport contract tests for #302 batch 1
claude Aug 19, 2026
9874adc
test: add async retry budget contract tests for #302 batch 2
claude Aug 19, 2026
413ed74
test: drop the ReadError case from the total retry budget test
claude Aug 19, 2026
727d855
test: add async concurrency isolation contract tests for #302 batch 3
claude Aug 19, 2026
777a9ea
test: add async adapter cleanup-after-use tests for #302 batch 4
claude Aug 19, 2026
28528a1
test: prove a final 5xx raises regardless of strict_http
claude Aug 19, 2026
70bf086
Merge pull request #316 from zero-sum-seattle/feature/302-async-trans…
Mattsface Aug 19, 2026
f68349b
feat: add initial AsyncMlb client vertical slice
Mattsface Aug 20, 2026
aef77fa
refactor(async): extract schedule parameter construction
Mattsface Aug 20, 2026
b3071ef
fix(async): preserve lazy exports and schedule parameters
Mattsface Aug 20, 2026
3150f9b
fix(async): repair package root and align AsyncMlb with the sync API
claude Aug 20, 2026
3a69256
test: focus the AsyncMlb suite and fix its resource cleanup
claude Aug 20, 2026
28029ab
refactor(async): move schedule params to helper
Mattsface Aug 21, 2026
90eceb5
test: freeze AsyncMlb public API contract
Mattsface Aug 21, 2026
9bfcfe8
test: remove live AsyncMlb tests from issue 303
Mattsface Aug 21, 2026
5da15bb
Merge pull request #319 from zero-sum-seattle/feature/303-async-mlb-v…
Mattsface Aug 21, 2026
bbc92d8
test: add sync and async live smoke coverage
Mattsface Aug 21, 2026
b2e4971
ci: install async extra for external tests
Mattsface Aug 21, 2026
74496bc
Merge pull request #320 from zero-sum-seattle/test/318-live-sync-asyn…
Mattsface Aug 21, 2026
96528f3
test: add sync/async parity coverage for get_team and get_person
claude Aug 21, 2026
c4a3547
test: add get_schedule sync async parity coverage
Mattsface Aug 22, 2026
076d7a8
test: add sync async failure parity coverage
Mattsface Aug 22, 2026
0eec6f6
test: refine sync async parity assertions
Mattsface Aug 22, 2026
b365df8
test: simplify and strengthen the sync/async parity suite
claude Aug 22, 2026
13e3cc6
Merge pull request #321 from zero-sum-seattle/test/304-sync-async-parity
Mattsface Aug 22, 2026
8a2695e
feat(async): expand AsyncMlb endpoint coverage for sport/league/divis…
Mattsface Aug 22, 2026
19dc8a7
feat(async): add get_season/get_seasons to AsyncMlb
Mattsface Aug 22, 2026
ee945e4
feat(async): add get_venue/get_venues and get_standings/get_attendanc…
Mattsface Aug 22, 2026
be7aca8
feat(async): add get_draft/get_awards to AsyncMlb
Mattsface Aug 22, 2026
99a88ed
feat(async): add get_homerun_derby to AsyncMlb
Mattsface Aug 22, 2026
673f68f
feat(async): add get_*_id name-lookup helpers to AsyncMlb
Mattsface Aug 22, 2026
b1b11d3
feat(async): add v1.1 adapter support and the game endpoint group to …
Mattsface Aug 22, 2026
abfc10d
refactor(async): replace the AsyncMlbDataAdapter retries_enabled cons…
Mattsface Aug 23, 2026
458d868
refactor(async): move retries and client ownership onto a shared tran…
Mattsface Aug 23, 2026
81672b0
Merge pull request #323 from zero-sum-seattle/refactor/async-shared-t…
Mattsface Aug 23, 2026
ab019e7
docs: tighten README and add async examples
Mattsface Aug 23, 2026
962d0ae
revert: keep README work on the dedicated docs branch
Mattsface Aug 23, 2026
7d2f0ec
feat(async): add the stat endpoint group to AsyncMlb
Mattsface Aug 23, 2026
113a8c0
feat(async): add the last three endpoints, completing AsyncMlb coverage
Mattsface Aug 23, 2026
cafedb8
Merge pull request #327 from zero-sum-seattle/feature/305-async-stats
Mattsface Aug 24, 2026
e98e9eb
Merge pull request #325 from zero-sum-seattle/feature/305-async-lookups
Mattsface Aug 24, 2026
8b99814
docs: add current async usage guide
Mattsface Aug 23, 2026
faf2ab4
docs: restore focused usage examples
Mattsface Aug 23, 2026
a8b38e6
docs: rebase README refactor onto 1.1 async surface
Mattsface Aug 23, 2026
6992c36
docs: restore contributor workflow after rebase
Mattsface Aug 23, 2026
0ded087
docs: restore method reference from README
Mattsface Aug 23, 2026
55ed8f9
docs: add explicit client cleanup examples
Mattsface Aug 25, 2026
23b0e55
docs: make async explicit cleanup example runnable
Mattsface Aug 25, 2026
0987030
docs: add sync explicit cleanup example
Mattsface Aug 25, 2026
a6c92ce
docs: clean up method reference formatting
Mattsface Aug 25, 2026
9b8e888
docs: make method reference easier to scan
Mattsface Aug 25, 2026
d416124
docs: add dedicated stats usage guide
Mattsface Aug 25, 2026
bafb125
docs: point stat examples to dedicated guide
Mattsface Aug 25, 2026
225f10e
docs: link method reference to stats guide
Mattsface Aug 25, 2026
77ead30
docs: link dedicated stats guide from README
Mattsface Aug 25, 2026
509567c
docs: align README with release validation
Mattsface Aug 25, 2026
7bef313
docs: avoid main()-shaped entry point in custom HTTPX client example
github-actions[bot] Aug 25, 2026
7f5b796
docs: add multiple invocation examples for custom HTTPX client section
github-actions[bot] Aug 25, 2026
779b3ac
docs: fix async endpoint coverage wording
Mattsface Aug 25, 2026
ffe4bd7
docs: remove duplicate schedule signature
Mattsface Aug 25, 2026
b8b7ebb
docs: clarify common method examples
Mattsface Aug 25, 2026
86dc00e
docs: reconcile async coverage claims and fix method signatures
github-actions[bot] Aug 25, 2026
0159a60
docs: list CI-validated Python versions
Mattsface Aug 25, 2026
31b69b7
Merge pull request #328 from zero-sum-seattle/feature/306-readme-refa…
Mattsface Aug 25, 2026
8ecb8c6
fix: honor environment proxies for library-created async clients
Mattsface Aug 26, 2026
648b297
test: address PR #331 review feedback on env-proxy tests
Mattsface Aug 26, 2026
ca0ef5f
cleanup: drop 1.1.0 release notes and trust_env param from PR #331
Mattsface Aug 27, 2026
cfe4887
Merge pull request #331 from zero-sum-seattle/fix/324-async-proxy-sup…
Mattsface Aug 27, 2026
12ff4d3
docs: define strict_http compatibility lifecycle (#309)
Mattsface Aug 27, 2026
8030e0f
Merge pull request #332 from zero-sum-seattle/docs/309-strict-http-li…
Mattsface Aug 27, 2026
4ad4948
release: prepare 1.1.0 validation
Mattsface Aug 27, 2026
178b0ca
Merge pull request #333 from zero-sum-seattle/release/prepare-1.1.0
Mattsface Aug 27, 2026
c54f23f
test: validate standalone async adapter artifact lifecycle
claude Aug 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 44 additions & 4 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ on:
pull_request:
branches:
- main
- release/1.0.0
- "release/**"
push:
branches:
- main
- release/1.0.0
- "release/**"
workflow_dispatch:

permissions:
Expand All @@ -27,7 +27,7 @@ jobs:
# first failure, so a single-version incompatibility is easy to isolate.
fail-fast: false
# Python 3.15 is intentionally absent: it is still a prerelease during the
# 1.0 release work and is not claimed as a supported version.
# 1.1 release work and is not claimed as a supported version.
matrix:
python-version:
- "3.10"
Expand All @@ -48,13 +48,53 @@ jobs:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Install dependencies
run: poetry install --no-interaction
run: poetry install --no-interaction -E async
- name: Run offline tests
run: |
poetry run pytest \
tests/ \
--ignore=tests/external_tests

sync-only:
name: Sync-only installation
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Python 3.14
uses: actions/setup-python@v5
with:
python-version: "3.14"

- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true

- name: Install dependencies without async extra
run: poetry install --no-interaction --only main

- name: Verify sync-only installation
run: |
poetry run python - <<'PY'
import importlib.util

assert importlib.util.find_spec("httpx") is None, (
"HTTPX should not be installed without the async extra"
)

import mlbstatsapi
from mlbstatsapi import Mlb, MlbDataAdapter

assert mlbstatsapi.Mlb is Mlb
assert mlbstatsapi.MlbDataAdapter is MlbDataAdapter

print("Sync-only installation verified without HTTPX")
PY


build-package:
name: Build and validate package
needs: offline-tests
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/claude-code-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Claude Code Review

on:
pull_request:
types: [opened, synchronize, ready_for_review, reopened]
# Optional: Only run on specific file changes
# paths:
# - "src/**/*.ts"
# - "src/**/*.tsx"
# - "src/**/*.js"
# - "src/**/*.jsx"

jobs:
claude-review:
# Optional: Filter by PR author
# if: |
# github.event.pull_request.user.login == 'external-contributor' ||
# github.event.pull_request.user.login == 'new-developer' ||
# github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'

runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
issues: read
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Run Claude Code Review
id: claude-review
uses: anthropics/claude-code-action@v1
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
plugin_marketplaces: 'https://github.com/anthropics/claude-code.git'
plugins: 'code-review@claude-code-plugins'
prompt: '/code-review:code-review --comment ${{ github.repository }}/pull/${{ github.event.pull_request.number }}'
claude_args: '--allowedTools "mcp__github_inline_comment__create_inline_comment"'
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
# or https://code.claude.com/docs/en/cli-reference for available options

50 changes: 50 additions & 0 deletions .github/workflows/claude.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Claude Code

on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
issues:
types: [opened, assigned]
pull_request_review:
types: [submitted]

jobs:
claude:
if: |
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
issues: read
id-token: write
actions: read # Required for Claude to read CI results on PRs
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Run Claude Code
id: claude
uses: anthropics/claude-code-action@v1
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}

# This is an optional setting that allows Claude to read CI results on PRs
additional_permissions: |
actions: read
# Optional: Give a custom prompt to Claude. If this is not specified, Claude will perform the instructions specified in the comment that tagged it.
# prompt: 'Update the pull request description to include a summary of changes.'

# Optional: Add claude_args to customize behavior and configuration
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
# or https://code.claude.com/docs/en/cli-reference for available options
# claude_args: '--allowed-tools Bash(gh pr *)'

2 changes: 1 addition & 1 deletion .github/workflows/external-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Install dependencies
run: poetry install --no-interaction
run: poetry install --no-interaction -E async
- name: Run external MLB API tests
run: |
poetry run pytest \
Expand Down
55 changes: 52 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,60 @@ Pull requests are the best way to propose changes to the codebase. We actively w
4. Ensure the test suite passes.
5. Issue that pull request!

## Development

Install dependencies:

```bash
poetry install -E async
```

Offline tests are deterministic and should run before every pull request:

```bash
poetry run pytest \
tests/ \
--ignore=tests/external_tests
```

External tests contact the live MLB API. They require internet access and are separate from normal offline CI:

```bash
poetry run pytest \
tests/external_tests/
```

These live tests may fail because the MLB service is unavailable or because MLB changes undocumented payloads.

Full local validation:

```bash
poetry run pytest tests/
rm -rf dist
poetry build
python3 scripts/validate_release.py
poetry run twine check dist/*
```

`scripts/validate_release.py` is the same release check offline CI runs. It inspects the built wheel and source distribution, clean-installs each artifact into its own temporary virtual environment, and runs the same public-API smoke test against both installed artifacts. Every response it observes comes from injected fake HTTP clients, so it never contacts the MLB API.

Offline CI is the normal pull-request gate. External tests are available manually, on a weekly schedule, and before releases.

## Pull Request Guidelines

- Run offline tests before submitting a PR
- Use the [PR template](.github/pull_request_template.md) when creating your pull request
- Follow the branch naming convention:
- `feat/` - New features
- `fix/` - Bug fixes
- `docs/` - Documentation updates
- `refactor/` - Code improvements

## Any contributions you make will be under the MIT Software License
In short, when you submit code changes, your submissions are understood to be under the same [MIT License](http://choosealicense.com/licenses/mit/) that covers the project. Feel free to contact the maintainers if that's a concern.

## Report bugs using Github's [issues](https://github.com/zero-sum-seattle/python-mlb-statsapi/issues)
We use GitHub issues to track public bugs. Report a bug by [opening a new issue](); it's that easy!
We use GitHub issues to track public bugs. Report a bug by [opening a new issue](https://github.com/zero-sum-seattle/python-mlb-statsapi/issues/new).

## Write bug reports with detail, background, and sample code
**Great Bug Reports** tend to have:
Expand All @@ -37,7 +86,7 @@ We use GitHub issues to track public bugs. Report a bug by [opening a new issue]
- Notes (possibly including why you think this might be happening, or stuff you tried that didn't work)

## Use a Consistent Coding Style
* Adhere to this projects coding style
* Adhere to this project's coding style

## License
By contributing, you agree that your contributions will be licensed under its MIT License.
By contributing, you agree that your contributions will be licensed under its MIT License.
Loading
Loading