pitchside 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. pitchside-0.1.0/.gitignore +23 -0
  2. pitchside-0.1.0/CHANGELOG.md +68 -0
  3. pitchside-0.1.0/LICENSE +21 -0
  4. pitchside-0.1.0/PKG-INFO +585 -0
  5. pitchside-0.1.0/README.md +551 -0
  6. pitchside-0.1.0/SECURITY.md +71 -0
  7. pitchside-0.1.0/docs/endpoint-audit.md +158 -0
  8. pitchside-0.1.0/docs/licences.md +26 -0
  9. pitchside-0.1.0/pyproject.toml +184 -0
  10. pitchside-0.1.0/src/pitchside/__about__.py +3 -0
  11. pitchside-0.1.0/src/pitchside/__init__.py +208 -0
  12. pitchside-0.1.0/src/pitchside/_client_base.py +164 -0
  13. pitchside-0.1.0/src/pitchside/_transport.py +400 -0
  14. pitchside-0.1.0/src/pitchside/aio.py +376 -0
  15. pitchside-0.1.0/src/pitchside/cache.py +399 -0
  16. pitchside-0.1.0/src/pitchside/cli.py +435 -0
  17. pitchside-0.1.0/src/pitchside/client.py +377 -0
  18. pitchside-0.1.0/src/pitchside/config.py +375 -0
  19. pitchside-0.1.0/src/pitchside/envelope.py +299 -0
  20. pitchside-0.1.0/src/pitchside/errors.py +418 -0
  21. pitchside-0.1.0/src/pitchside/models/__init__.py +225 -0
  22. pitchside-0.1.0/src/pitchside/models/base.py +416 -0
  23. pitchside-0.1.0/src/pitchside/models/catalogue.py +137 -0
  24. pitchside-0.1.0/src/pitchside/models/combat.py +177 -0
  25. pitchside-0.1.0/src/pitchside/models/common.py +242 -0
  26. pitchside-0.1.0/src/pitchside/models/cricket.py +203 -0
  27. pitchside-0.1.0/src/pitchside/models/leaders.py +181 -0
  28. pitchside-0.1.0/src/pitchside/models/matches.py +214 -0
  29. pitchside-0.1.0/src/pitchside/models/nba.py +161 -0
  30. pitchside-0.1.0/src/pitchside/models/nfl.py +179 -0
  31. pitchside-0.1.0/src/pitchside/models/odds.py +263 -0
  32. pitchside-0.1.0/src/pitchside/models/platform.py +191 -0
  33. pitchside-0.1.0/src/pitchside/models/players.py +196 -0
  34. pitchside-0.1.0/src/pitchside/models/standings.py +149 -0
  35. pitchside-0.1.0/src/pitchside/models/teams.py +287 -0
  36. pitchside-0.1.0/src/pitchside/models/wc2026.py +247 -0
  37. pitchside-0.1.0/src/pitchside/pagination.py +255 -0
  38. pitchside-0.1.0/src/pitchside/py.typed +0 -0
  39. pitchside-0.1.0/src/pitchside/resources/__init__.py +150 -0
  40. pitchside-0.1.0/src/pitchside/resources/_base.py +381 -0
  41. pitchside-0.1.0/src/pitchside/resources/catalogue.py +264 -0
  42. pitchside-0.1.0/src/pitchside/resources/combat.py +183 -0
  43. pitchside-0.1.0/src/pitchside/resources/cricket.py +228 -0
  44. pitchside-0.1.0/src/pitchside/resources/extras.py +281 -0
  45. pitchside-0.1.0/src/pitchside/resources/intelligence.py +343 -0
  46. pitchside-0.1.0/src/pitchside/resources/matches.py +319 -0
  47. pitchside-0.1.0/src/pitchside/resources/mlb.py +101 -0
  48. pitchside-0.1.0/src/pitchside/resources/nba.py +453 -0
  49. pitchside-0.1.0/src/pitchside/resources/nfl.py +533 -0
  50. pitchside-0.1.0/src/pitchside/resources/nhl.py +166 -0
  51. pitchside-0.1.0/src/pitchside/resources/odds.py +343 -0
  52. pitchside-0.1.0/src/pitchside/resources/platform.py +78 -0
  53. pitchside-0.1.0/src/pitchside/resources/players.py +647 -0
  54. pitchside-0.1.0/src/pitchside/resources/standings.py +209 -0
  55. pitchside-0.1.0/src/pitchside/resources/stored.py +444 -0
  56. pitchside-0.1.0/src/pitchside/resources/teams.py +757 -0
  57. pitchside-0.1.0/src/pitchside/resources/wc2026.py +445 -0
  58. pitchside-0.1.0/src/pitchside/resources/webhooks.py +139 -0
  59. pitchside-0.1.0/src/pitchside/streaming.py +429 -0
  60. pitchside-0.1.0/src/pitchside/webhooks.py +232 -0
  61. pitchside-0.1.0/tests/__init__.py +1 -0
  62. pitchside-0.1.0/tests/conftest.py +235 -0
  63. pitchside-0.1.0/tests/data/openapi_paths.json +362 -0
  64. pitchside-0.1.0/tests/test_cache.py +253 -0
  65. pitchside-0.1.0/tests/test_client.py +412 -0
  66. pitchside-0.1.0/tests/test_contract.py +296 -0
  67. pitchside-0.1.0/tests/test_envelope.py +162 -0
  68. pitchside-0.1.0/tests/test_errors.py +294 -0
  69. pitchside-0.1.0/tests/test_live.py +305 -0
  70. pitchside-0.1.0/tests/test_models.py +494 -0
  71. pitchside-0.1.0/tests/test_resources.py +430 -0
  72. pitchside-0.1.0/tests/test_streaming.py +335 -0
  73. pitchside-0.1.0/tests/test_webhooks.py +200 -0
@@ -0,0 +1,23 @@
1
+ # Python-generated files
2
+ __pycache__/
3
+ *.py[oc]
4
+ build/
5
+ dist/
6
+ wheels/
7
+ *.egg-info
8
+
9
+ # Virtual environments
10
+ .venv
11
+
12
+ # Secrets. Never commit a real API key.
13
+ .env
14
+ .env.*
15
+ !.env.example
16
+
17
+ # Tooling caches
18
+ .pytest_cache/
19
+ .ruff_cache/
20
+ .mypy_cache/
21
+ .coverage
22
+ coverage.xml
23
+ htmlcov/
@@ -0,0 +1,68 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented here.
4
+
5
+ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [0.1.0] - 2026-08-28
11
+
12
+ First release. Wraps all 118 documented endpoints of the Big Balls Sports
13
+ Data API, sync and async.
14
+
15
+ ### Added
16
+
17
+ - **Clients.** `Pitchside` and `AsyncPitchside`, with identical method
18
+ names and signatures across 22 resource namespaces. A contract test
19
+ enforces that they do not drift apart.
20
+ - **Envelope normalisation.** The API uses at least five response shapes
21
+ depending on the route, and `pitchside.envelope` reduces them to one.
22
+ Collections nested under route-specific keys (`data.matches`,
23
+ `data.leaders`, `data.groups`, …) are unwrapped to plain lists.
24
+ - **Typed errors.** Full hierarchy under `PitchsideError`, with
25
+ `PlanRequiredError.required_plan` parsed from the upstream message or
26
+ `upgrade_path`, and `RateLimitError.is_circuit_breaker` distinguishing
27
+ quota exhaustion from the 4xx breaker.
28
+ - **Unified "not found".** A real `404`, a `200` with `data: null`, and a
29
+ `200` carrying `meta.coverage: false` all raise `NotFoundError`.
30
+ - **Retries.** Exponential backoff with full jitter, honouring
31
+ `Retry-After`, capped so a day-long quota reset fails fast rather than
32
+ hanging. Only idempotent requests are replayed.
33
+ - **Pagination.** `Page` / `AsyncPage` with `auto_paging_iter()`.
34
+ Routes that accept `?offset=` but report no pagination block get a
35
+ synthesised one, so paging works there too.
36
+ - **Rate-limit tracking.** `client.rate_limit` parses `X-RateLimit-*`,
37
+ including the per-route budgets that sit on top of the account-wide one.
38
+ - **Models.** Lenient by design, so unknown fields are preserved and
39
+ reachable via `.get()`, since the published spec and the live service
40
+ disagree in many places. Upstream data-quality issues are normalised on
41
+ parse (padded player names, string percentages, mixed jersey types).
42
+ - **Webhooks.** Subscription CRUD with idempotency, plus
43
+ `pitchside.webhooks.verify_signature()` for delivery verification,
44
+ constant-time comparison and a replay window.
45
+ - **Streaming.** Polling-based live scores, sync and async, single-match
46
+ and whole-slate, with an interval floor to protect quota.
47
+ - **CLI.** `pitchside` via the `cli` extra, with `--json` on every command.
48
+
49
+ ### Notes on the upstream API
50
+
51
+ Documented in full in the README, and pinned by tests that report when the
52
+ vendor fixes them:
53
+
54
+ - `GET /v1/teams/{id}/season` returns `500` unconditionally.
55
+ - `GET /v1/matches/{id}/events` returns a fixed demo payload unrelated to
56
+ the requested fixture.
57
+ - `GET /v1/players/{id}` requires an undocumented `?sport=`, then times
58
+ out. Use `client.players.profile()`.
59
+ - `GET /v1/injuries` requires `sport` or `team` despite the spec marking
60
+ both optional, and often exceeds 30 seconds.
61
+ - The advertised WebSocket at `wss://api.bigballsdata.com/live` is
62
+ non-functional, because every URL and auth style tested has its
63
+ handshake rejected with `400`. `pitchside.streaming` polls instead.
64
+ - Identifiers are not interchangeable between routes. See the README.
65
+ - `WebhookEvent` follows the server validator, which disagrees with both
66
+ the OpenAPI spec and the public docs page.
67
+
68
+ [0.1.0]: https://pypi.org/project/pitchside/0.1.0/
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 The pitchside authors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.