baseball-api-wrapper 0.1.0__tar.gz → 0.2.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.
- {baseball_api_wrapper-0.1.0 → baseball_api_wrapper-0.2.0}/PKG-INFO +17 -12
- {baseball_api_wrapper-0.1.0 → baseball_api_wrapper-0.2.0}/README.md +9 -6
- {baseball_api_wrapper-0.1.0 → baseball_api_wrapper-0.2.0}/baseball_api_wrapper/__init__.py +4 -3
- {baseball_api_wrapper-0.1.0 → baseball_api_wrapper-0.2.0}/baseball_api_wrapper/client.py +2 -1
- {baseball_api_wrapper-0.1.0 → baseball_api_wrapper-0.2.0}/baseball_api_wrapper/modules/roster.py +1 -2
- {baseball_api_wrapper-0.1.0 → baseball_api_wrapper-0.2.0}/baseball_api_wrapper.egg-info/PKG-INFO +17 -12
- baseball_api_wrapper-0.2.0/baseball_api_wrapper.egg-info/requires.txt +8 -0
- {baseball_api_wrapper-0.1.0 → baseball_api_wrapper-0.2.0}/pyproject.toml +12 -6
- {baseball_api_wrapper-0.1.0 → baseball_api_wrapper-0.2.0}/tests/test_games.py +1 -2
- {baseball_api_wrapper-0.1.0 → baseball_api_wrapper-0.2.0}/tests/test_players.py +5 -2
- {baseball_api_wrapper-0.1.0 → baseball_api_wrapper-0.2.0}/tests/test_roster.py +0 -1
- {baseball_api_wrapper-0.1.0 → baseball_api_wrapper-0.2.0}/tests/test_teams.py +1 -2
- baseball_api_wrapper-0.1.0/baseball_api_wrapper.egg-info/requires.txt +0 -6
- {baseball_api_wrapper-0.1.0 → baseball_api_wrapper-0.2.0}/LICENSE +0 -0
- {baseball_api_wrapper-0.1.0 → baseball_api_wrapper-0.2.0}/baseball_api_wrapper/modules/__init__.py +0 -0
- {baseball_api_wrapper-0.1.0 → baseball_api_wrapper-0.2.0}/baseball_api_wrapper/modules/games.py +0 -0
- {baseball_api_wrapper-0.1.0 → baseball_api_wrapper-0.2.0}/baseball_api_wrapper/modules/players.py +0 -0
- {baseball_api_wrapper-0.1.0 → baseball_api_wrapper-0.2.0}/baseball_api_wrapper/modules/teams.py +0 -0
- {baseball_api_wrapper-0.1.0 → baseball_api_wrapper-0.2.0}/baseball_api_wrapper.egg-info/SOURCES.txt +0 -0
- {baseball_api_wrapper-0.1.0 → baseball_api_wrapper-0.2.0}/baseball_api_wrapper.egg-info/dependency_links.txt +0 -0
- {baseball_api_wrapper-0.1.0 → baseball_api_wrapper-0.2.0}/baseball_api_wrapper.egg-info/top_level.txt +0 -0
- {baseball_api_wrapper-0.1.0 → baseball_api_wrapper-0.2.0}/setup.cfg +0 -0
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: baseball-api-wrapper
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
4
4
|
Summary: A Python wrapper for the official MLB Stats API (https://statsapi.mlb.com)
|
|
5
5
|
License-Expression: MIT
|
|
6
|
-
Requires-Python: >=3.
|
|
6
|
+
Requires-Python: >=3.10
|
|
7
7
|
Description-Content-Type: text/markdown
|
|
8
8
|
License-File: LICENSE
|
|
9
|
-
Requires-Dist: requests>=2.
|
|
9
|
+
Requires-Dist: requests>=2.32.4
|
|
10
10
|
Provides-Extra: dev
|
|
11
|
-
Requires-Dist: pytest
|
|
12
|
-
Requires-Dist: pytest-cov
|
|
13
|
-
Requires-Dist:
|
|
11
|
+
Requires-Dist: pytest==9.0.2; extra == "dev"
|
|
12
|
+
Requires-Dist: pytest-cov==7.0.0; extra == "dev"
|
|
13
|
+
Requires-Dist: ruff==0.17.2; extra == "dev"
|
|
14
|
+
Requires-Dist: build==1.6.1; extra == "dev"
|
|
15
|
+
Requires-Dist: twine==7.0.0; extra == "dev"
|
|
14
16
|
Dynamic: license-file
|
|
15
17
|
|
|
16
18
|
# baseball-api-wrapper
|
|
@@ -19,18 +21,21 @@ A Python wrapper for the official [MLB Stats API](https://statsapi.mlb.com).
|
|
|
19
21
|
|
|
20
22
|
## Installation
|
|
21
23
|
|
|
22
|
-
|
|
24
|
+
Install from [PyPI](https://pypi.org/project/baseball-api-wrapper/):
|
|
23
25
|
|
|
24
26
|
```bash
|
|
25
|
-
|
|
26
|
-
cd baseball-api-wrapper
|
|
27
|
-
pip install -e ".[dev]" # includes pytest and test dependencies
|
|
27
|
+
pip install baseball-api-wrapper
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
### Development
|
|
31
|
+
|
|
32
|
+
Clone the repo and install in editable mode so changes to the source are reflected immediately:
|
|
31
33
|
|
|
32
34
|
```bash
|
|
33
|
-
|
|
35
|
+
git clone https://github.com/pyerra27/baseball-api-wrapper.git
|
|
36
|
+
cd baseball-api-wrapper
|
|
37
|
+
pip install -e ".[dev]" # includes pytest, ruff and test dependencies
|
|
38
|
+
ruff check . # import order + unused imports (check only)
|
|
34
39
|
```
|
|
35
40
|
|
|
36
41
|
## Quick Start
|
|
@@ -4,18 +4,21 @@ A Python wrapper for the official [MLB Stats API](https://statsapi.mlb.com).
|
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Install from [PyPI](https://pypi.org/project/baseball-api-wrapper/):
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
|
|
11
|
-
cd baseball-api-wrapper
|
|
12
|
-
pip install -e ".[dev]" # includes pytest and test dependencies
|
|
10
|
+
pip install baseball-api-wrapper
|
|
13
11
|
```
|
|
14
12
|
|
|
15
|
-
|
|
13
|
+
### Development
|
|
14
|
+
|
|
15
|
+
Clone the repo and install in editable mode so changes to the source are reflected immediately:
|
|
16
16
|
|
|
17
17
|
```bash
|
|
18
|
-
|
|
18
|
+
git clone https://github.com/pyerra27/baseball-api-wrapper.git
|
|
19
|
+
cd baseball-api-wrapper
|
|
20
|
+
pip install -e ".[dev]" # includes pytest, ruff and test dependencies
|
|
21
|
+
ruff check . # import order + unused imports (check only)
|
|
19
22
|
```
|
|
20
23
|
|
|
21
24
|
## Quick Start
|
|
@@ -13,15 +13,16 @@ Quick start::
|
|
|
13
13
|
"""
|
|
14
14
|
|
|
15
15
|
from .client import MLBStatsAPIError, MLBStatsClient
|
|
16
|
+
from .modules.games import get_boxscore, get_game_by_pk, get_schedule
|
|
17
|
+
from .modules.players import get_player_career_splits, get_player_info, get_player_stats
|
|
18
|
+
from .modules.roster import RosterType, get_roster
|
|
16
19
|
from .modules.teams import get_teams
|
|
17
|
-
from .modules.roster import get_roster
|
|
18
|
-
from .modules.players import get_player_info, get_player_stats, get_player_career_splits
|
|
19
|
-
from .modules.games import get_schedule, get_boxscore, get_game_by_pk
|
|
20
20
|
|
|
21
21
|
__all__ = [
|
|
22
22
|
"MLBStatsClient",
|
|
23
23
|
"MLBStatsAPIError",
|
|
24
24
|
"get_teams",
|
|
25
|
+
"RosterType",
|
|
25
26
|
"get_roster",
|
|
26
27
|
"get_player_info",
|
|
27
28
|
"get_player_stats",
|
|
@@ -7,9 +7,10 @@ This module provides a low-level HTTP client that handles request construction,
|
|
|
7
7
|
error handling, and response parsing for the MLB Stats API.
|
|
8
8
|
"""
|
|
9
9
|
|
|
10
|
-
import requests
|
|
11
10
|
from typing import Any, Dict, Optional
|
|
12
11
|
|
|
12
|
+
import requests
|
|
13
|
+
|
|
13
14
|
|
|
14
15
|
class MLBStatsAPIError(Exception):
|
|
15
16
|
"""Raised when the MLB Stats API returns an error response."""
|
{baseball_api_wrapper-0.1.0 → baseball_api_wrapper-0.2.0}/baseball_api_wrapper/modules/roster.py
RENAMED
|
@@ -23,6 +23,7 @@ enum. The most commonly used types are:
|
|
|
23
23
|
* ``COACH`` – Coaching staff.
|
|
24
24
|
"""
|
|
25
25
|
|
|
26
|
+
import datetime
|
|
26
27
|
from enum import Enum
|
|
27
28
|
from typing import Any, Dict, List, Optional
|
|
28
29
|
|
|
@@ -154,8 +155,6 @@ def _validate_date(date: str) -> None:
|
|
|
154
155
|
Raises:
|
|
155
156
|
ValueError: If the string is not a valid ``YYYY-MM-DD`` date.
|
|
156
157
|
"""
|
|
157
|
-
import datetime
|
|
158
|
-
|
|
159
158
|
try:
|
|
160
159
|
datetime.date.fromisoformat(date)
|
|
161
160
|
except ValueError:
|
{baseball_api_wrapper-0.1.0 → baseball_api_wrapper-0.2.0}/baseball_api_wrapper.egg-info/PKG-INFO
RENAMED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: baseball-api-wrapper
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
4
4
|
Summary: A Python wrapper for the official MLB Stats API (https://statsapi.mlb.com)
|
|
5
5
|
License-Expression: MIT
|
|
6
|
-
Requires-Python: >=3.
|
|
6
|
+
Requires-Python: >=3.10
|
|
7
7
|
Description-Content-Type: text/markdown
|
|
8
8
|
License-File: LICENSE
|
|
9
|
-
Requires-Dist: requests>=2.
|
|
9
|
+
Requires-Dist: requests>=2.32.4
|
|
10
10
|
Provides-Extra: dev
|
|
11
|
-
Requires-Dist: pytest
|
|
12
|
-
Requires-Dist: pytest-cov
|
|
13
|
-
Requires-Dist:
|
|
11
|
+
Requires-Dist: pytest==9.0.2; extra == "dev"
|
|
12
|
+
Requires-Dist: pytest-cov==7.0.0; extra == "dev"
|
|
13
|
+
Requires-Dist: ruff==0.17.2; extra == "dev"
|
|
14
|
+
Requires-Dist: build==1.6.1; extra == "dev"
|
|
15
|
+
Requires-Dist: twine==7.0.0; extra == "dev"
|
|
14
16
|
Dynamic: license-file
|
|
15
17
|
|
|
16
18
|
# baseball-api-wrapper
|
|
@@ -19,18 +21,21 @@ A Python wrapper for the official [MLB Stats API](https://statsapi.mlb.com).
|
|
|
19
21
|
|
|
20
22
|
## Installation
|
|
21
23
|
|
|
22
|
-
|
|
24
|
+
Install from [PyPI](https://pypi.org/project/baseball-api-wrapper/):
|
|
23
25
|
|
|
24
26
|
```bash
|
|
25
|
-
|
|
26
|
-
cd baseball-api-wrapper
|
|
27
|
-
pip install -e ".[dev]" # includes pytest and test dependencies
|
|
27
|
+
pip install baseball-api-wrapper
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
### Development
|
|
31
|
+
|
|
32
|
+
Clone the repo and install in editable mode so changes to the source are reflected immediately:
|
|
31
33
|
|
|
32
34
|
```bash
|
|
33
|
-
|
|
35
|
+
git clone https://github.com/pyerra27/baseball-api-wrapper.git
|
|
36
|
+
cd baseball-api-wrapper
|
|
37
|
+
pip install -e ".[dev]" # includes pytest, ruff and test dependencies
|
|
38
|
+
ruff check . # import order + unused imports (check only)
|
|
34
39
|
```
|
|
35
40
|
|
|
36
41
|
## Quick Start
|
|
@@ -4,22 +4,24 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "baseball-api-wrapper"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.2.0"
|
|
8
8
|
description = "A Python wrapper for the official MLB Stats API (https://statsapi.mlb.com)"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "MIT"
|
|
11
11
|
license-files = ["LICENSE"]
|
|
12
|
-
requires-python = ">=3.
|
|
12
|
+
requires-python = ">=3.10"
|
|
13
13
|
dependencies = [
|
|
14
|
-
"requests>=2.
|
|
14
|
+
"requests>=2.32.4", # Floor excludes CVE-2023-32681, CVE-2024-35195, CVE-2024-47081
|
|
15
15
|
]
|
|
16
16
|
|
|
17
17
|
[project.optional-dependencies]
|
|
18
18
|
# Install dev/test tools with: pip install -e ".[dev]"
|
|
19
19
|
dev = [
|
|
20
|
-
"pytest
|
|
21
|
-
"pytest-cov
|
|
22
|
-
"
|
|
20
|
+
"pytest==9.0.2",
|
|
21
|
+
"pytest-cov==7.0.0",
|
|
22
|
+
"ruff==0.17.2", # Lint: import order + unused imports
|
|
23
|
+
"build==1.6.1", # Release: build sdist + wheel
|
|
24
|
+
"twine==7.0.0", # Release: check and upload to PyPI
|
|
23
25
|
]
|
|
24
26
|
|
|
25
27
|
[tool.setuptools.packages.find]
|
|
@@ -34,3 +36,7 @@ addopts = "-v --tb=short"
|
|
|
34
36
|
[tool.coverage.run]
|
|
35
37
|
source = ["baseball_api_wrapper"]
|
|
36
38
|
omit = ["tests/*"]
|
|
39
|
+
|
|
40
|
+
[tool.ruff.lint]
|
|
41
|
+
# Check only (no --fix): import sorting/grouping (I) and unused imports (F401)
|
|
42
|
+
select = ["I", "F401"]
|
|
@@ -15,13 +15,12 @@ from unittest.mock import MagicMock, patch
|
|
|
15
15
|
|
|
16
16
|
from baseball_api_wrapper.client import MLBStatsAPIError, MLBStatsClient
|
|
17
17
|
from baseball_api_wrapper.modules.games import (
|
|
18
|
+
MLB_SPORT_ID,
|
|
18
19
|
get_boxscore,
|
|
19
20
|
get_game_by_pk,
|
|
20
21
|
get_schedule,
|
|
21
|
-
MLB_SPORT_ID,
|
|
22
22
|
)
|
|
23
23
|
|
|
24
|
-
|
|
25
24
|
# ---------------------------------------------------------------------------
|
|
26
25
|
# Fixtures
|
|
27
26
|
# ---------------------------------------------------------------------------
|
|
@@ -17,8 +17,11 @@ import unittest
|
|
|
17
17
|
from unittest.mock import MagicMock, patch
|
|
18
18
|
|
|
19
19
|
from baseball_api_wrapper.client import MLBStatsAPIError, MLBStatsClient
|
|
20
|
-
from baseball_api_wrapper.modules.players import
|
|
21
|
-
|
|
20
|
+
from baseball_api_wrapper.modules.players import (
|
|
21
|
+
get_player_career_splits,
|
|
22
|
+
get_player_info,
|
|
23
|
+
get_player_stats,
|
|
24
|
+
)
|
|
22
25
|
|
|
23
26
|
# ---------------------------------------------------------------------------
|
|
24
27
|
# Fixtures
|
|
@@ -18,7 +18,6 @@ from unittest.mock import MagicMock, patch
|
|
|
18
18
|
from baseball_api_wrapper.client import MLBStatsAPIError, MLBStatsClient
|
|
19
19
|
from baseball_api_wrapper.modules.roster import RosterType, get_roster
|
|
20
20
|
|
|
21
|
-
|
|
22
21
|
# ---------------------------------------------------------------------------
|
|
23
22
|
# Fixtures
|
|
24
23
|
# ---------------------------------------------------------------------------
|
|
@@ -14,8 +14,7 @@ import unittest
|
|
|
14
14
|
from unittest.mock import MagicMock, patch
|
|
15
15
|
|
|
16
16
|
from baseball_api_wrapper.client import MLBStatsAPIError, MLBStatsClient
|
|
17
|
-
from baseball_api_wrapper.modules.teams import
|
|
18
|
-
|
|
17
|
+
from baseball_api_wrapper.modules.teams import MLB_SPORT_ID, get_teams
|
|
19
18
|
|
|
20
19
|
# ---------------------------------------------------------------------------
|
|
21
20
|
# Fixtures
|
|
File without changes
|
{baseball_api_wrapper-0.1.0 → baseball_api_wrapper-0.2.0}/baseball_api_wrapper/modules/__init__.py
RENAMED
|
File without changes
|
{baseball_api_wrapper-0.1.0 → baseball_api_wrapper-0.2.0}/baseball_api_wrapper/modules/games.py
RENAMED
|
File without changes
|
{baseball_api_wrapper-0.1.0 → baseball_api_wrapper-0.2.0}/baseball_api_wrapper/modules/players.py
RENAMED
|
File without changes
|
{baseball_api_wrapper-0.1.0 → baseball_api_wrapper-0.2.0}/baseball_api_wrapper/modules/teams.py
RENAMED
|
File without changes
|
{baseball_api_wrapper-0.1.0 → baseball_api_wrapper-0.2.0}/baseball_api_wrapper.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|