Skip to content

Commit 11280b4

Browse files
authored
Multiple fixes and updates (#349)
* refreshed .gitignore for vscode. * Adding support for VSCode, black, and standardizing settings.json. * Added support for VSCode Dev Containers. * Revert "Update playbyplay.py (#337)" This reverts commit 5076fae. File updated should have been src/nba_api/live/nba/library/http.py. * Version Bump. Updated Readme * Change Log Update
1 parent 1eac7e2 commit 11280b4

File tree

7 files changed

+74
-4
lines changed

7 files changed

+74
-4
lines changed

.devcontainer/devcontainer.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"containerEnv": {
3+
"PYTHON_VERSION": "3.11",
4+
"PYTHON_PATH": ""
5+
},
6+
"features": {
7+
"ghcr.io/devcontainers/features/python:latest": {
8+
"version": "3.11"
9+
},
10+
"ghcr.io/devcontainers-contrib/features/poetry:2": {}
11+
},
12+
"image": "mcr.microsoft.com/devcontainers/base:debian",
13+
"name": "nba_data",
14+
"postCreateCommand": "bash .devcontainer/postCreateCommand.sh",
15+
"remoteEnv": {
16+
"PYTHONUTF8": "1"
17+
},
18+
"customizations": {
19+
"vscode": {
20+
"extensions": [
21+
"ms-python.python"
22+
]
23+
}
24+
}
25+
}

.devcontainer/postCreateCommand.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
CONSTRAINT_URL=https://raw.githubusercontent.com/apache/airflow/constraints-${AIRFLOW_VERSION}/constraints-${PYTHON_VERSION}.txt
2+
pip install --upgrade pip
3+
poetry install --no-root
4+
# pip install "apache-airflow==${AIRFLOW_VERSION}" --constraint "${CONSTRAINT_URL}"
5+
#(airflow standalone) &

.gitignore

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,4 +124,11 @@ nba_api/library/debug/
124124
!.vscode/settings.json
125125
!.vscode/tasks.json
126126
!.vscode/launch.json
127-
!.vscode/extensions.json
127+
!.vscode/extensions.json
128+
!.vscode/*.code-snippets
129+
130+
# Local History for Visual Studio Code
131+
.history/
132+
133+
# Built Visual Studio Code Extensions
134+
*.vsix

.vscode/settings.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"editor.formatOnSave": true,
3+
"python.linting.flake8Enabled": true,
4+
"python.formatting.provider": "black",
5+
"python.formatting.blackArgs": [
6+
"--line-length",
7+
"88"
8+
],
9+
"python.analysis.diagnosticSeverityOverrides": {
10+
"reportUnboundVariable": "information",
11+
"reportImplicitStringConcatenation": "warning",
12+
"reportUntypedFunctionDecorator": "information",
13+
}
14+
}

CHANGELOG.MD

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,25 @@
1616

1717
# Version History
1818

19+
## v1.2.1
20+
21+
Date: 2023-06-13
22+
23+
### Security
24+
- [requests](https://github.com/psf/requests) bumped from 2.28.2 to 2.31.0 via #344 - @dependabot
25+
26+
### Fixed
27+
28+
- Reverted alexfayad@5076fae050ec7d655af300cde7674756c4381943. Change broke materialized url and test. Original URL was found to be valid.
29+
- Resolved bad url in documentation #322 - @alexfayad
30+
- Fixed typo in causing src/nba_api/stats/endpoints/playerindex.py to fail #340 - @shufinskiy
31+
- Fixed expired Slack URL #347
32+
33+
34+
### Developer Tools
35+
- Support for VS Code Dev Containers (including auto-format via [black](https://github.com/psf/black))
36+
37+
1938
## v1.2.0
2039

2140
Date: 2023-03-23

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
44

55
[tool.poetry]
66
name = "nba_api"
7-
version = "1.2"
7+
version = "1.2.1"
88
description = "An API Client package to access the APIs for NBA.com"
99
license = "MIT"
1010
authors = [

src/nba_api/live/nba/endpoints/playbyplay.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
from nba_api.live.nba.library.http import NBALiveHTTP
33

44
class PlayByPlay(Endpoint):
5-
endpoint_url = 'https://cdn.nba.com/static/json/liveData/playbyplay/playbyplay_{game_id}.json'
6-
expected_data = {'meta': {'version': 1, 'code': 200, 'request': 'https://cdn.nba.com/static/json/liveData/playbyplay/playbyplay_0022000180.json', 'time': '2021-01-15 23:48:58.906160'}, 'game': {'gameId': '0022000180', 'actions': [{'actionNumber': 4, 'clock': 'PT11M58.00S', 'timeActual': '2021-01-16T00:40:31.3Z', 'period': 1, 'periodType': 'REGULAR', 'teamId': 1610612738, 'teamTricode': 'BOS', 'actionType': 'jumpball', 'subType': 'recovered', 'descriptor': 'startperiod', 'qualifiers': [], 'personId': 1629684, 'x': None, 'y': None, 'possession': 1610612738, 'scoreHome': '0', 'scoreAway': '0', 'edited': '2021-01-16T00:40:31Z', 'orderNumber': 40000, 'xLegacy': None, 'yLegacy': None, 'isFieldGoal': 0, 'jumpBallRecoveredName': 'G. Williams', 'jumpBallRecoverdPersonId': 1629684, 'side': None, 'playerName': 'Williams', 'playerNameI': 'G. Williams', 'personIdsFilter': [1629684, 202684, 202696], 'jumpBallWonPlayerName': 'Thompson', 'jumpBallWonPersonId': 202684, 'description': 'Jump Ball T. Thompson vs. N. Vucevic: Tip to G. Williams', 'jumpBallLostPlayerName': 'Vucevic', 'jumpBallLostPersonId': 202696}]}}
5+
endpoint_url = 'playbyplay/playbyplay_{game_id}.json'
6+
expected_data = {'meta': {'version': 1, 'code': 200, 'request': 'http://nba.cloud/games/0022000180/playbyplay?Format=json', 'time': '2021-01-15 23:48:58.906160'}, 'game': {'gameId': '0022000180', 'actions': [{'actionNumber': 4, 'clock': 'PT11M58.00S', 'timeActual': '2021-01-16T00:40:31.3Z', 'period': 1, 'periodType': 'REGULAR', 'teamId': 1610612738, 'teamTricode': 'BOS', 'actionType': 'jumpball', 'subType': 'recovered', 'descriptor': 'startperiod', 'qualifiers': [], 'personId': 1629684, 'x': None, 'y': None, 'possession': 1610612738, 'scoreHome': '0', 'scoreAway': '0', 'edited': '2021-01-16T00:40:31Z', 'orderNumber': 40000, 'xLegacy': None, 'yLegacy': None, 'isFieldGoal': 0, 'jumpBallRecoveredName': 'G. Williams', 'jumpBallRecoverdPersonId': 1629684, 'side': None, 'playerName': 'Williams', 'playerNameI': 'G. Williams', 'personIdsFilter': [1629684, 202684, 202696], 'jumpBallWonPlayerName': 'Thompson', 'jumpBallWonPersonId': 202684, 'description': 'Jump Ball T. Thompson vs. N. Vucevic: Tip to G. Williams', 'jumpBallLostPlayerName': 'Vucevic', 'jumpBallLostPersonId': 202696}]}}
77

88
#Data Sets
99
game = Endpoint.DataSet

0 commit comments

Comments
 (0)