nbastatpy 0.3.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.
- nbastatpy-0.3.0/.github/.release-please-manifest.json +3 -0
- nbastatpy-0.3.0/.github/dependabot.yml +25 -0
- nbastatpy-0.3.0/.github/workflows/lint.yml +32 -0
- nbastatpy-0.3.0/.github/workflows/pre-commit.yml +26 -0
- nbastatpy-0.3.0/.github/workflows/publish.yml +39 -0
- nbastatpy-0.3.0/.github/workflows/release-please.yml +19 -0
- nbastatpy-0.3.0/.github/workflows/run_tests.yml +33 -0
- nbastatpy-0.3.0/.github/workflows/security.yml +39 -0
- nbastatpy-0.3.0/.github/workflows/type-check.yml +30 -0
- nbastatpy-0.3.0/.gitignore +166 -0
- nbastatpy-0.3.0/.pre-commit-config.yaml +34 -0
- nbastatpy-0.3.0/CHANGELOG.md +16 -0
- nbastatpy-0.3.0/LICENSE +21 -0
- nbastatpy-0.3.0/PKG-INFO +130 -0
- nbastatpy-0.3.0/README.md +111 -0
- nbastatpy-0.3.0/mypy.ini +39 -0
- nbastatpy-0.3.0/pyproject.toml +71 -0
- nbastatpy-0.3.0/release-please-config.json +12 -0
- nbastatpy-0.3.0/src/nbastatpy/__init__.py +15 -0
- nbastatpy-0.3.0/src/nbastatpy/config.py +445 -0
- nbastatpy-0.3.0/src/nbastatpy/game.py +254 -0
- nbastatpy-0.3.0/src/nbastatpy/league.py +906 -0
- nbastatpy-0.3.0/src/nbastatpy/mcp/__init__.py +0 -0
- nbastatpy-0.3.0/src/nbastatpy/mcp/server.py +21 -0
- nbastatpy-0.3.0/src/nbastatpy/mcp/tools/game_tools.py +277 -0
- nbastatpy-0.3.0/src/nbastatpy/mcp/tools/league_tools.py +65 -0
- nbastatpy-0.3.0/src/nbastatpy/mcp/tools/player_tools.py +311 -0
- nbastatpy-0.3.0/src/nbastatpy/mcp/tools/team_tools.py +199 -0
- nbastatpy-0.3.0/src/nbastatpy/player.py +729 -0
- nbastatpy-0.3.0/src/nbastatpy/standardize.py +619 -0
- nbastatpy-0.3.0/src/nbastatpy/team.py +648 -0
- nbastatpy-0.3.0/src/nbastatpy/utils.py +326 -0
- nbastatpy-0.3.0/tests/test_game.py +8 -0
- nbastatpy-0.3.0/tests/test_league.py +8 -0
- nbastatpy-0.3.0/tests/test_mcp_server.py +475 -0
- nbastatpy-0.3.0/tests/test_mcp_tools.py +992 -0
- nbastatpy-0.3.0/tests/test_player.py +97 -0
- nbastatpy-0.3.0/tests/test_standardize.py +280 -0
- nbastatpy-0.3.0/tests/test_team.py +59 -0
- nbastatpy-0.3.0/uv.lock +3194 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
updates:
|
|
3
|
+
# Python dependencies
|
|
4
|
+
- package-ecosystem: "pip"
|
|
5
|
+
directory: "/"
|
|
6
|
+
schedule:
|
|
7
|
+
interval: "weekly"
|
|
8
|
+
open-pull-requests-limit: 5
|
|
9
|
+
labels:
|
|
10
|
+
- "dependencies"
|
|
11
|
+
- "python"
|
|
12
|
+
reviewers:
|
|
13
|
+
- "aberghammer-analytics"
|
|
14
|
+
|
|
15
|
+
# GitHub Actions
|
|
16
|
+
- package-ecosystem: "github-actions"
|
|
17
|
+
directory: "/"
|
|
18
|
+
schedule:
|
|
19
|
+
interval: "weekly"
|
|
20
|
+
open-pull-requests-limit: 5
|
|
21
|
+
labels:
|
|
22
|
+
- "dependencies"
|
|
23
|
+
- "github-actions"
|
|
24
|
+
reviewers:
|
|
25
|
+
- "aberghammer-analytics"
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
name: Lint
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
workflow_dispatch:
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
ruff:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v4
|
|
16
|
+
|
|
17
|
+
- name: Install uv
|
|
18
|
+
uses: astral-sh/setup-uv@v4
|
|
19
|
+
|
|
20
|
+
- name: Set up Python
|
|
21
|
+
uses: actions/setup-python@v5
|
|
22
|
+
with:
|
|
23
|
+
python-version: "3.10"
|
|
24
|
+
|
|
25
|
+
- name: Install the project
|
|
26
|
+
run: uv sync --all-extras --dev
|
|
27
|
+
|
|
28
|
+
- name: Run Ruff linter
|
|
29
|
+
run: uv run ruff check --output-format=github .
|
|
30
|
+
|
|
31
|
+
- name: Run Ruff formatter check
|
|
32
|
+
run: uv run ruff format --check .
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
name: Pre-commit Checks
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
workflow_dispatch:
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
pre-commit:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v4
|
|
16
|
+
|
|
17
|
+
- name: Set up Python
|
|
18
|
+
uses: actions/setup-python@v5
|
|
19
|
+
with:
|
|
20
|
+
python-version: "3.10"
|
|
21
|
+
|
|
22
|
+
- name: Install pre-commit
|
|
23
|
+
run: pip install pre-commit
|
|
24
|
+
|
|
25
|
+
- name: Run pre-commit
|
|
26
|
+
run: pre-commit run --all-files --show-diff-on-failure
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
# Triggered automatically by release-please when it creates a GitHub release
|
|
4
|
+
on:
|
|
5
|
+
release:
|
|
6
|
+
types: [created]
|
|
7
|
+
workflow_dispatch: # Manual trigger option
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
pypi-publish:
|
|
11
|
+
name: Publish release to PyPI
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
permissions:
|
|
14
|
+
id-token: write
|
|
15
|
+
contents: read
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v4
|
|
19
|
+
|
|
20
|
+
- name: Install uv
|
|
21
|
+
uses: astral-sh/setup-uv@v4
|
|
22
|
+
|
|
23
|
+
- name: Set up Python
|
|
24
|
+
uses: actions/setup-python@v5
|
|
25
|
+
with:
|
|
26
|
+
python-version: "3.10"
|
|
27
|
+
|
|
28
|
+
- name: Install the project
|
|
29
|
+
run: uv sync --all-extras --dev
|
|
30
|
+
|
|
31
|
+
# Tests are run by main CI workflows - skipping here to avoid NBA API timeouts
|
|
32
|
+
# - name: Run tests before publishing
|
|
33
|
+
# run: uv run pytest tests
|
|
34
|
+
|
|
35
|
+
- name: Build package
|
|
36
|
+
run: uv build
|
|
37
|
+
|
|
38
|
+
- name: Publish package distributions to PyPI
|
|
39
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
name: Release Please
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: write
|
|
10
|
+
pull-requests: write
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
release-please:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
steps:
|
|
16
|
+
- uses: googleapis/release-please-action@v4
|
|
17
|
+
id: release
|
|
18
|
+
with:
|
|
19
|
+
manifest-file: .github/.release-please-manifest.json
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
name: Run Pytest
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
workflow_dispatch:
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
test:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
strategy:
|
|
14
|
+
fail-fast: false
|
|
15
|
+
matrix:
|
|
16
|
+
python-version: ["3.10", "3.11", "3.12"]
|
|
17
|
+
|
|
18
|
+
steps:
|
|
19
|
+
- uses: actions/checkout@v4
|
|
20
|
+
|
|
21
|
+
- name: Install uv
|
|
22
|
+
uses: astral-sh/setup-uv@v4
|
|
23
|
+
|
|
24
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
25
|
+
uses: actions/setup-python@v5
|
|
26
|
+
with:
|
|
27
|
+
python-version: ${{ matrix.python-version }}
|
|
28
|
+
|
|
29
|
+
- name: Install the project
|
|
30
|
+
run: uv sync --all-extras --dev
|
|
31
|
+
|
|
32
|
+
- name: Run tests with coverage
|
|
33
|
+
run: uv run pytest tests --cov=src/nbastatpy --cov-report=html --cov-report=term-missing
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
name: Security Scan
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
schedule:
|
|
9
|
+
# Run weekly on Mondays at 8am UTC
|
|
10
|
+
- cron: '0 8 * * 1'
|
|
11
|
+
workflow_dispatch:
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
safety:
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v4
|
|
19
|
+
|
|
20
|
+
- name: Install uv
|
|
21
|
+
uses: astral-sh/setup-uv@v4
|
|
22
|
+
|
|
23
|
+
- name: Set up Python
|
|
24
|
+
uses: actions/setup-python@v5
|
|
25
|
+
with:
|
|
26
|
+
python-version: "3.10"
|
|
27
|
+
|
|
28
|
+
- name: Install the project
|
|
29
|
+
run: uv sync --all-extras --dev
|
|
30
|
+
|
|
31
|
+
- name: Run Safety check
|
|
32
|
+
run: uv run safety check --json
|
|
33
|
+
continue-on-error: true
|
|
34
|
+
|
|
35
|
+
- name: Run pip-audit
|
|
36
|
+
run: |
|
|
37
|
+
uv pip install pip-audit
|
|
38
|
+
uv run pip-audit --format json
|
|
39
|
+
continue-on-error: true
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
name: Type Check
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
workflow_dispatch:
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
mypy:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v4
|
|
16
|
+
|
|
17
|
+
- name: Install uv
|
|
18
|
+
uses: astral-sh/setup-uv@v4
|
|
19
|
+
|
|
20
|
+
- name: Set up Python
|
|
21
|
+
uses: actions/setup-python@v5
|
|
22
|
+
with:
|
|
23
|
+
python-version: "3.10"
|
|
24
|
+
|
|
25
|
+
- name: Install the project
|
|
26
|
+
run: uv sync --all-extras --dev
|
|
27
|
+
|
|
28
|
+
- name: Run mypy
|
|
29
|
+
run: uv run mypy src/nbastatpy --config-file mypy.ini
|
|
30
|
+
continue-on-error: true
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nox/
|
|
43
|
+
.coverage
|
|
44
|
+
.coverage.*
|
|
45
|
+
.cache
|
|
46
|
+
nosetests.xml
|
|
47
|
+
coverage.xml
|
|
48
|
+
*.cover
|
|
49
|
+
*.py,cover
|
|
50
|
+
.hypothesis/
|
|
51
|
+
.pytest_cache/
|
|
52
|
+
cover/
|
|
53
|
+
|
|
54
|
+
# Translations
|
|
55
|
+
*.mo
|
|
56
|
+
*.pot
|
|
57
|
+
|
|
58
|
+
# Django stuff:
|
|
59
|
+
*.log
|
|
60
|
+
local_settings.py
|
|
61
|
+
db.sqlite3
|
|
62
|
+
db.sqlite3-journal
|
|
63
|
+
|
|
64
|
+
# Flask stuff:
|
|
65
|
+
instance/
|
|
66
|
+
.webassets-cache
|
|
67
|
+
|
|
68
|
+
# Scrapy stuff:
|
|
69
|
+
.scrapy
|
|
70
|
+
|
|
71
|
+
# Sphinx documentation
|
|
72
|
+
docs/_build/
|
|
73
|
+
|
|
74
|
+
# PyBuilder
|
|
75
|
+
.pybuilder/
|
|
76
|
+
target/
|
|
77
|
+
|
|
78
|
+
# Jupyter Notebook
|
|
79
|
+
.ipynb_checkpoints
|
|
80
|
+
|
|
81
|
+
# IPython
|
|
82
|
+
profile_default/
|
|
83
|
+
ipython_config.py
|
|
84
|
+
|
|
85
|
+
# pyenv
|
|
86
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
87
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
88
|
+
# .python-version
|
|
89
|
+
|
|
90
|
+
# pipenv
|
|
91
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
92
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
93
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
94
|
+
# install all needed dependencies.
|
|
95
|
+
#Pipfile.lock
|
|
96
|
+
|
|
97
|
+
# poetry
|
|
98
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
99
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
100
|
+
# commonly ignored for libraries.
|
|
101
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
102
|
+
#poetry.lock
|
|
103
|
+
|
|
104
|
+
# pdm
|
|
105
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
106
|
+
#pdm.lock
|
|
107
|
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
108
|
+
# in version control.
|
|
109
|
+
# https://pdm.fming.dev/#use-with-ide
|
|
110
|
+
.pdm.toml
|
|
111
|
+
|
|
112
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
113
|
+
__pypackages__/
|
|
114
|
+
|
|
115
|
+
# Celery stuff
|
|
116
|
+
celerybeat-schedule
|
|
117
|
+
celerybeat.pid
|
|
118
|
+
|
|
119
|
+
# SageMath parsed files
|
|
120
|
+
*.sage.py
|
|
121
|
+
|
|
122
|
+
# Environments
|
|
123
|
+
.env
|
|
124
|
+
.venv
|
|
125
|
+
env/
|
|
126
|
+
venv/
|
|
127
|
+
ENV/
|
|
128
|
+
env.bak/
|
|
129
|
+
venv.bak/
|
|
130
|
+
|
|
131
|
+
# Spyder project settings
|
|
132
|
+
.spyderproject
|
|
133
|
+
.spyproject
|
|
134
|
+
|
|
135
|
+
# Rope project settings
|
|
136
|
+
.ropeproject
|
|
137
|
+
|
|
138
|
+
# mkdocs documentation
|
|
139
|
+
/site
|
|
140
|
+
|
|
141
|
+
# mypy
|
|
142
|
+
.mypy_cache/
|
|
143
|
+
.dmypy.json
|
|
144
|
+
dmypy.json
|
|
145
|
+
|
|
146
|
+
# Pyre type checker
|
|
147
|
+
.pyre/
|
|
148
|
+
|
|
149
|
+
# pytype static type analyzer
|
|
150
|
+
.pytype/
|
|
151
|
+
|
|
152
|
+
# Cython debug symbols
|
|
153
|
+
cython_debug/
|
|
154
|
+
|
|
155
|
+
# PyCharm
|
|
156
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
157
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
158
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
159
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
160
|
+
#.idea/
|
|
161
|
+
|
|
162
|
+
.DS_Store
|
|
163
|
+
.scratch/
|
|
164
|
+
.vscode/
|
|
165
|
+
.claude/
|
|
166
|
+
TODO.md
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
repos:
|
|
2
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
3
|
+
rev: v5.0.0
|
|
4
|
+
hooks:
|
|
5
|
+
- id: trailing-whitespace
|
|
6
|
+
- id: end-of-file-fixer
|
|
7
|
+
- id: check-yaml
|
|
8
|
+
- id: check-added-large-files
|
|
9
|
+
args: ['--maxkb=1000']
|
|
10
|
+
- id: check-json
|
|
11
|
+
- id: check-toml
|
|
12
|
+
- id: check-merge-conflict
|
|
13
|
+
- id: debug-statements
|
|
14
|
+
- id: mixed-line-ending
|
|
15
|
+
|
|
16
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
17
|
+
rev: v0.8.4
|
|
18
|
+
hooks:
|
|
19
|
+
- id: ruff
|
|
20
|
+
args: [--fix, --exit-non-zero-on-fix]
|
|
21
|
+
- id: ruff-format
|
|
22
|
+
|
|
23
|
+
- repo: https://github.com/pre-commit/mirrors-mypy
|
|
24
|
+
rev: v1.13.0
|
|
25
|
+
hooks:
|
|
26
|
+
- id: mypy
|
|
27
|
+
additional_dependencies:
|
|
28
|
+
- types-requests
|
|
29
|
+
- pandas-stubs
|
|
30
|
+
files: ^src/
|
|
31
|
+
args: [--config-file=mypy.ini]
|
|
32
|
+
verbose: true
|
|
33
|
+
# Make mypy advisory only (won't block commits)
|
|
34
|
+
stages: [manual]
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [0.3.0](https://github.com/aberghammer-analytics/NBAStatPy/compare/nbastatpy-v0.2.0...nbastatpy-v0.3.0) (2026-01-18)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* Add MCP integration for AI-powered NBA data access ([#13](https://github.com/aberghammer-analytics/NBAStatPy/issues/13)) ([388fa33](https://github.com/aberghammer-analytics/NBAStatPy/commit/388fa331983103cd159e4073fba865bc522bd97b))
|
|
9
|
+
|
|
10
|
+
## [0.2.0](https://github.com/aberghammer-analytics/NBAStatPy/compare/nbastatpy-v0.1.8...nbastatpy-v0.2.0) (2025-10-05)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* add data standardization and validation ([c5fc869](https://github.com/aberghammer-analytics/NBAStatPy/commit/c5fc869530964dec63bf7052d3fe645957642362))
|
|
16
|
+
* update release ([b10f99b](https://github.com/aberghammer-analytics/NBAStatPy/commit/b10f99bc3e107b796f9d9591961021fee7f2e12d))
|
nbastatpy-0.3.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 aberghammer-analytics
|
|
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.
|
nbastatpy-0.3.0/PKG-INFO
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: nbastatpy
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: An easy-to-use wrapper for nba_api to easily find data for a player, game, team, or season
|
|
5
|
+
License-File: LICENSE
|
|
6
|
+
Keywords: basketball,data,nba,sports,stats
|
|
7
|
+
Classifier: Intended Audience :: Science/Research
|
|
8
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
9
|
+
Requires-Python: >=3.10
|
|
10
|
+
Requires-Dist: bs4>=0.0.2
|
|
11
|
+
Requires-Dist: fastmcp<3,>=2
|
|
12
|
+
Requires-Dist: loguru>=0.7.3
|
|
13
|
+
Requires-Dist: nba-api>=1.6.1
|
|
14
|
+
Requires-Dist: pandas>=2.2.3
|
|
15
|
+
Requires-Dist: pillow>=11.0.0
|
|
16
|
+
Requires-Dist: requests>=2.32.3
|
|
17
|
+
Requires-Dist: rich>=13.9.4
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
|
|
20
|
+
# NBAStatPy
|
|
21
|
+
|
|
22
|
+
[](https://badge.fury.io/py/nbastatpy)
|
|
23
|
+
[](https://www.python.org/downloads/)
|
|
24
|
+
[](https://github.com/aberghammer-analytics/NBAStatPy/actions)
|
|
25
|
+
|
|
26
|
+
## Overview
|
|
27
|
+
|
|
28
|
+
A simple, easy-to-use wrapper for the `nba_api` package to access NBA data for players, games, teams, and seasons.
|
|
29
|
+
|
|
30
|
+
## Quick Start
|
|
31
|
+
|
|
32
|
+
```python
|
|
33
|
+
from nbastatpy.player import Player
|
|
34
|
+
|
|
35
|
+
# Create a player object
|
|
36
|
+
player = Player("Giannis", season="2023", playoffs=True)
|
|
37
|
+
|
|
38
|
+
# Get data
|
|
39
|
+
awards = player.get_awards()
|
|
40
|
+
stats = player.get_career_stats()
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Main Classes
|
|
44
|
+
|
|
45
|
+
- **Player** - Access player stats, career data, and awards
|
|
46
|
+
- **Game** - Get boxscores, play-by-play, and game details
|
|
47
|
+
- **League** - Query league-wide stats, lineups, and tracking data
|
|
48
|
+
- **Team** - Retrieve team rosters, stats, and splits
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
### Standalone Usage
|
|
52
|
+
|
|
53
|
+
```python
|
|
54
|
+
from nbastatpy.standardize import standardize_dataframe
|
|
55
|
+
|
|
56
|
+
df = standardize_dataframe(df, data_type='player')
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## MCP Integration (AI Assistant Tools)
|
|
60
|
+
|
|
61
|
+
NBAStatPy includes a [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server that allows AI assistants like Claude to access NBA data directly.
|
|
62
|
+
|
|
63
|
+
### Available Tools
|
|
64
|
+
|
|
65
|
+
| Tool | Description |
|
|
66
|
+
|------|-------------|
|
|
67
|
+
| `get_player_salary` | Get player salary data by name |
|
|
68
|
+
| `get_player_game_logs` | Get recent game logs for a player |
|
|
69
|
+
| `get_player_career_stats` | Get season-by-season career statistics |
|
|
70
|
+
| `get_player_play_type_stats` | Get play type (synergy) stats for a player |
|
|
71
|
+
| `get_player_tracking_stats` | Get tracking stats (drives, touches, etc.) |
|
|
72
|
+
| `get_league_leaders` | Get league leaders for any stat category |
|
|
73
|
+
| `get_team_recent_games` | Get recent games for a team |
|
|
74
|
+
| `get_team_play_type_stats` | Get play type stats for a team |
|
|
75
|
+
| `get_team_tracking_stats` | Get tracking stats for a team |
|
|
76
|
+
| `get_recent_games_summary` | Get summary of recent NBA games |
|
|
77
|
+
| `get_recent_games_player_stats` | Get player stats from recent games |
|
|
78
|
+
|
|
79
|
+
### Claude Code Integration
|
|
80
|
+
|
|
81
|
+
Add to your Claude Code MCP settings (`~/.claude/settings.json`):
|
|
82
|
+
|
|
83
|
+
```json
|
|
84
|
+
{
|
|
85
|
+
"mcpServers": {
|
|
86
|
+
"nbastatpy": {
|
|
87
|
+
"command": "uvx",
|
|
88
|
+
"args": ["--from", "nbastatpy", "nbastatpy-mcp"]
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Or with pip:
|
|
95
|
+
|
|
96
|
+
```json
|
|
97
|
+
{
|
|
98
|
+
"mcpServers": {
|
|
99
|
+
"nbastatpy": {
|
|
100
|
+
"command": "python",
|
|
101
|
+
"args": ["-m", "nbastatpy.mcp.server"]
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Running the MCP Server Manually
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
# With uvx (recommended)
|
|
111
|
+
uvx --from nbastatpy nbastatpy-mcp
|
|
112
|
+
|
|
113
|
+
# With uv
|
|
114
|
+
uv run python -m nbastatpy.mcp.server
|
|
115
|
+
|
|
116
|
+
# With pip install
|
|
117
|
+
python -m nbastatpy.mcp.server
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Installation
|
|
121
|
+
|
|
122
|
+
### Pip
|
|
123
|
+
```bash
|
|
124
|
+
pip install nbastatpy
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### UV
|
|
128
|
+
```bash
|
|
129
|
+
uv add nbastatpy
|
|
130
|
+
```
|