isapy-data 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.
Potentially problematic release.
This version of isapy-data might be problematic. Click here for more details.
- isapy_data-0.1.0/LICENSE +21 -0
- isapy_data-0.1.0/PKG-INFO +128 -0
- isapy_data-0.1.0/README.md +98 -0
- isapy_data-0.1.0/pyproject.toml +48 -0
- isapy_data-0.1.0/setup.cfg +4 -0
- isapy_data-0.1.0/src/isapy_data/__init__.py +204 -0
- isapy_data-0.1.0/src/isapy_data/data/avs_roster_2021.csv +27 -0
- isapy_data-0.1.0/src/isapy_data/data/avs_roster_2022.csv +25 -0
- isapy_data-0.1.0/src/isapy_data/data/avs_stats_2021.csv +189 -0
- isapy_data-0.1.0/src/isapy_data/data/avs_stats_2022.csv +163 -0
- isapy_data-0.1.0/src/isapy_data/data/dk_edm_col.csv +253 -0
- isapy_data-0.1.0/src/isapy_data/data/dk_lac_dal.csv +69 -0
- isapy_data-0.1.0/src/isapy_data/data/dk_mem_utah.csv +69 -0
- isapy_data-0.1.0/src/isapy_data/data/dk_nyr_car.csv +253 -0
- isapy_data-0.1.0/src/isapy_data/data/epl_gk_stats_2022.csv +43 -0
- isapy_data-0.1.0/src/isapy_data/data/epl_gk_stats_2023.csv +40 -0
- isapy_data-0.1.0/src/isapy_data/data/epl_gk_stats_2024.csv +41 -0
- isapy_data-0.1.0/src/isapy_data/data/epl_gk_stats_2025.csv +45 -0
- isapy_data-0.1.0/src/isapy_data/data/epl_player_stats_2022.csv +546 -0
- isapy_data-0.1.0/src/isapy_data/data/epl_player_stats_2023.csv +570 -0
- isapy_data-0.1.0/src/isapy_data/data/epl_player_stats_2024.csv +581 -0
- isapy_data-0.1.0/src/isapy_data/data/epl_player_stats_2025.csv +575 -0
- isapy_data-0.1.0/src/isapy_data/data/epl_team_stats.csv +101 -0
- isapy_data-0.1.0/src/isapy_data/data/epl_team_stats_2023.csv +21 -0
- isapy_data-0.1.0/src/isapy_data/data/epl_team_stats_2024.csv +21 -0
- isapy_data-0.1.0/src/isapy_data/data/epl_team_stats_2025.csv +21 -0
- isapy_data-0.1.0/src/isapy_data/data/masters.csv +88 -0
- isapy_data-0.1.0/src/isapy_data/data/nba_adv_team_2021.csv +2161 -0
- isapy_data-0.1.0/src/isapy_data/data/nba_adv_team_2023.csv +2461 -0
- isapy_data-0.1.0/src/isapy_data/data/nba_adv_team_2024.csv +2461 -0
- isapy_data-0.1.0/src/isapy_data/data/nba_adv_team_2025.csv +2461 -0
- isapy_data-0.1.0/src/isapy_data/data/nba_ff_team_2021.csv +2161 -0
- isapy_data-0.1.0/src/isapy_data/data/nba_ff_team_2023.csv +2461 -0
- isapy_data-0.1.0/src/isapy_data/data/nba_ff_team_2024.csv +2461 -0
- isapy_data-0.1.0/src/isapy_data/data/nba_ff_team_2025.csv +2461 -0
- isapy_data-0.1.0/src/isapy_data/data/nba_games_2021.csv +2161 -0
- isapy_data-0.1.0/src/isapy_data/data/nba_games_2023.csv +2461 -0
- isapy_data-0.1.0/src/isapy_data/data/nba_games_2024.csv +2461 -0
- isapy_data-0.1.0/src/isapy_data/data/nba_games_2025.csv +2461 -0
- isapy_data-0.1.0/src/isapy_data/data/nba_nuggets_shots.csv +62197 -0
- isapy_data-0.1.0/src/isapy_data/data/nhl_data_hockey_reference.csv +12376 -0
- isapy_data-0.1.0/src/isapy_data/data/nhl_team_stats_2021.csv +33 -0
- isapy_data-0.1.0/src/isapy_data/data/nhl_team_stats_2022.csv +33 -0
- isapy_data-0.1.0/src/isapy_data/data/nwsl_player_stats.csv +315 -0
- isapy_data-0.1.0/src/isapy_data/data/nwsl_player_stats_2023.csv +308 -0
- isapy_data-0.1.0/src/isapy_data/data/nwsl_player_stats_2024.csv +377 -0
- isapy_data-0.1.0/src/isapy_data/data/ow_golf_rankings.csv +301 -0
- isapy_data-0.1.0/src/isapy_data/data/pga_tournaments.csv +3677 -0
- isapy_data-0.1.0/src/isapy_data.egg-info/PKG-INFO +128 -0
- isapy_data-0.1.0/src/isapy_data.egg-info/SOURCES.txt +51 -0
- isapy_data-0.1.0/src/isapy_data.egg-info/dependency_links.txt +1 -0
- isapy_data-0.1.0/src/isapy_data.egg-info/requires.txt +6 -0
- isapy_data-0.1.0/src/isapy_data.egg-info/top_level.txt +1 -0
isapy_data-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Ryan Elmore
|
|
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.
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: isapy-data
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Data package for Introduction to Sports Analytics using Python
|
|
5
|
+
Author-email: Ryan Elmore <ryan.elmore@du.edu>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/rtelmore/ISAPy
|
|
8
|
+
Project-URL: Repository, https://github.com/rtelmore/ISAPy
|
|
9
|
+
Project-URL: Documentation, https://datacolorado.com/python/ISAPy/
|
|
10
|
+
Keywords: sports,analytics,data,statistics,python
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Intended Audience :: Education
|
|
13
|
+
Classifier: Intended Audience :: Science/Research
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Topic :: Scientific/Engineering
|
|
21
|
+
Requires-Python: >=3.9
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
License-File: LICENSE
|
|
24
|
+
Requires-Dist: pandas>=1.5.0
|
|
25
|
+
Provides-Extra: dev
|
|
26
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
27
|
+
Requires-Dist: build; extra == "dev"
|
|
28
|
+
Requires-Dist: twine; extra == "dev"
|
|
29
|
+
Dynamic: license-file
|
|
30
|
+
|
|
31
|
+
# ISAPy
|
|
32
|
+
|
|
33
|
+
Data package for *Introduction to Sports Analytics using Python* by Ryan Elmore.
|
|
34
|
+
|
|
35
|
+
## Installation
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
pip install isapy-data
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
For development:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
pip install -e ".[dev]"
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Usage
|
|
48
|
+
|
|
49
|
+
```python
|
|
50
|
+
import isapy_data
|
|
51
|
+
|
|
52
|
+
# List all available datasets
|
|
53
|
+
isapy_data.list_datasets()
|
|
54
|
+
|
|
55
|
+
# Load a dataset
|
|
56
|
+
masters = isapy_data.load_data("masters")
|
|
57
|
+
|
|
58
|
+
# Get information about a specific dataset
|
|
59
|
+
isapy_data.describe("masters")
|
|
60
|
+
|
|
61
|
+
# Print info about all datasets
|
|
62
|
+
isapy_data.info()
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Available Datasets
|
|
66
|
+
|
|
67
|
+
### Golf
|
|
68
|
+
- `masters` - Masters Tournament data
|
|
69
|
+
- `ow_golf_rankings` - Official World Golf Rankings
|
|
70
|
+
- `pga_tournaments` - PGA Tour tournament data
|
|
71
|
+
|
|
72
|
+
### NBA
|
|
73
|
+
- `nba_adv_team_2021`, `nba_adv_team_2023`, `nba_adv_team_2024`, `nba_adv_team_2025` - Advanced team statistics
|
|
74
|
+
- `nba_ff_team_2021`, `nba_ff_team_2023`, `nba_ff_team_2024`, `nba_ff_team_2025` - Four factors team statistics
|
|
75
|
+
- `nba_games_2021`, `nba_games_2023`, `nba_games_2024`, `nba_games_2025` - Game results
|
|
76
|
+
- `nba_nuggets_shots` - Denver Nuggets shot location data
|
|
77
|
+
|
|
78
|
+
### NHL
|
|
79
|
+
- `avs_roster_2021`, `avs_roster_2022` - Colorado Avalanche roster data
|
|
80
|
+
- `avs_stats_2021`, `avs_stats_2022` - Colorado Avalanche player statistics
|
|
81
|
+
- `nhl_data_hockey_reference` - NHL data from Hockey Reference
|
|
82
|
+
- `nhl_team_stats_2021`, `nhl_team_stats_2022` - NHL team statistics
|
|
83
|
+
|
|
84
|
+
### English Premier League
|
|
85
|
+
- `epl_gk_stats_2022` through `epl_gk_stats_2025` - Goalkeeper statistics
|
|
86
|
+
- `epl_player_stats_2022` through `epl_player_stats_2025` - Player statistics
|
|
87
|
+
- `epl_team_stats`, `epl_team_stats_2023`, `epl_team_stats_2024`, `epl_team_stats_2025` - Team statistics
|
|
88
|
+
|
|
89
|
+
### NWSL
|
|
90
|
+
- `nwsl_player_stats`, `nwsl_player_stats_2023`, `nwsl_player_stats_2024` - Player statistics
|
|
91
|
+
|
|
92
|
+
### DraftKings
|
|
93
|
+
- `dk_edm_col` - Edmonton vs Colorado
|
|
94
|
+
- `dk_lac_dal` - LA Clippers vs Dallas
|
|
95
|
+
- `dk_mem_utah` - Memphis vs Utah
|
|
96
|
+
- `dk_nyr_car` - NY Rangers vs Carolina
|
|
97
|
+
|
|
98
|
+
## Development
|
|
99
|
+
|
|
100
|
+
### Exporting Data from ISAR
|
|
101
|
+
|
|
102
|
+
To export data from the R package ISAR to CSV format:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
Rscript scripts/export_rda_to_csv.R
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Building the Package
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
python -m build
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Publishing to PyPI
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
python -m twine upload dist/*
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## License
|
|
121
|
+
|
|
122
|
+
MIT
|
|
123
|
+
|
|
124
|
+
## Citation
|
|
125
|
+
|
|
126
|
+
If you use this data in your research, please cite:
|
|
127
|
+
|
|
128
|
+
> Elmore, R. (2025). *Introduction to Sports Analytics using Python*.
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# ISAPy
|
|
2
|
+
|
|
3
|
+
Data package for *Introduction to Sports Analytics using Python* by Ryan Elmore.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pip install isapy-data
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
For development:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
pip install -e ".[dev]"
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
```python
|
|
20
|
+
import isapy_data
|
|
21
|
+
|
|
22
|
+
# List all available datasets
|
|
23
|
+
isapy_data.list_datasets()
|
|
24
|
+
|
|
25
|
+
# Load a dataset
|
|
26
|
+
masters = isapy_data.load_data("masters")
|
|
27
|
+
|
|
28
|
+
# Get information about a specific dataset
|
|
29
|
+
isapy_data.describe("masters")
|
|
30
|
+
|
|
31
|
+
# Print info about all datasets
|
|
32
|
+
isapy_data.info()
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Available Datasets
|
|
36
|
+
|
|
37
|
+
### Golf
|
|
38
|
+
- `masters` - Masters Tournament data
|
|
39
|
+
- `ow_golf_rankings` - Official World Golf Rankings
|
|
40
|
+
- `pga_tournaments` - PGA Tour tournament data
|
|
41
|
+
|
|
42
|
+
### NBA
|
|
43
|
+
- `nba_adv_team_2021`, `nba_adv_team_2023`, `nba_adv_team_2024`, `nba_adv_team_2025` - Advanced team statistics
|
|
44
|
+
- `nba_ff_team_2021`, `nba_ff_team_2023`, `nba_ff_team_2024`, `nba_ff_team_2025` - Four factors team statistics
|
|
45
|
+
- `nba_games_2021`, `nba_games_2023`, `nba_games_2024`, `nba_games_2025` - Game results
|
|
46
|
+
- `nba_nuggets_shots` - Denver Nuggets shot location data
|
|
47
|
+
|
|
48
|
+
### NHL
|
|
49
|
+
- `avs_roster_2021`, `avs_roster_2022` - Colorado Avalanche roster data
|
|
50
|
+
- `avs_stats_2021`, `avs_stats_2022` - Colorado Avalanche player statistics
|
|
51
|
+
- `nhl_data_hockey_reference` - NHL data from Hockey Reference
|
|
52
|
+
- `nhl_team_stats_2021`, `nhl_team_stats_2022` - NHL team statistics
|
|
53
|
+
|
|
54
|
+
### English Premier League
|
|
55
|
+
- `epl_gk_stats_2022` through `epl_gk_stats_2025` - Goalkeeper statistics
|
|
56
|
+
- `epl_player_stats_2022` through `epl_player_stats_2025` - Player statistics
|
|
57
|
+
- `epl_team_stats`, `epl_team_stats_2023`, `epl_team_stats_2024`, `epl_team_stats_2025` - Team statistics
|
|
58
|
+
|
|
59
|
+
### NWSL
|
|
60
|
+
- `nwsl_player_stats`, `nwsl_player_stats_2023`, `nwsl_player_stats_2024` - Player statistics
|
|
61
|
+
|
|
62
|
+
### DraftKings
|
|
63
|
+
- `dk_edm_col` - Edmonton vs Colorado
|
|
64
|
+
- `dk_lac_dal` - LA Clippers vs Dallas
|
|
65
|
+
- `dk_mem_utah` - Memphis vs Utah
|
|
66
|
+
- `dk_nyr_car` - NY Rangers vs Carolina
|
|
67
|
+
|
|
68
|
+
## Development
|
|
69
|
+
|
|
70
|
+
### Exporting Data from ISAR
|
|
71
|
+
|
|
72
|
+
To export data from the R package ISAR to CSV format:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
Rscript scripts/export_rda_to_csv.R
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Building the Package
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
python -m build
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Publishing to PyPI
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
python -m twine upload dist/*
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## License
|
|
91
|
+
|
|
92
|
+
MIT
|
|
93
|
+
|
|
94
|
+
## Citation
|
|
95
|
+
|
|
96
|
+
If you use this data in your research, please cite:
|
|
97
|
+
|
|
98
|
+
> Elmore, R. (2025). *Introduction to Sports Analytics using Python*.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "isapy-data"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Data package for Introduction to Sports Analytics using Python"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = {text = "MIT"}
|
|
11
|
+
authors = [
|
|
12
|
+
{name = "Ryan Elmore", email = "ryan.elmore@du.edu"},
|
|
13
|
+
]
|
|
14
|
+
keywords = ["sports", "analytics", "data", "statistics", "python"]
|
|
15
|
+
classifiers = [
|
|
16
|
+
"Development Status :: 3 - Alpha",
|
|
17
|
+
"Intended Audience :: Education",
|
|
18
|
+
"Intended Audience :: Science/Research",
|
|
19
|
+
"License :: OSI Approved :: MIT License",
|
|
20
|
+
"Programming Language :: Python :: 3",
|
|
21
|
+
"Programming Language :: Python :: 3.9",
|
|
22
|
+
"Programming Language :: Python :: 3.10",
|
|
23
|
+
"Programming Language :: Python :: 3.11",
|
|
24
|
+
"Programming Language :: Python :: 3.12",
|
|
25
|
+
"Topic :: Scientific/Engineering",
|
|
26
|
+
]
|
|
27
|
+
requires-python = ">=3.9"
|
|
28
|
+
dependencies = [
|
|
29
|
+
"pandas>=1.5.0",
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
[project.optional-dependencies]
|
|
33
|
+
dev = [
|
|
34
|
+
"pytest>=7.0",
|
|
35
|
+
"build",
|
|
36
|
+
"twine",
|
|
37
|
+
]
|
|
38
|
+
|
|
39
|
+
[project.urls]
|
|
40
|
+
Homepage = "https://github.com/rtelmore/ISAPy"
|
|
41
|
+
Repository = "https://github.com/rtelmore/ISAPy"
|
|
42
|
+
Documentation = "https://datacolorado.com/python/ISAPy/"
|
|
43
|
+
|
|
44
|
+
[tool.setuptools.packages.find]
|
|
45
|
+
where = ["src"]
|
|
46
|
+
|
|
47
|
+
[tool.setuptools.package-data]
|
|
48
|
+
isapy_data = ["data/*.csv"]
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
"""
|
|
2
|
+
ISAPy: Data package for Introduction to Sports Analytics using Python.
|
|
3
|
+
|
|
4
|
+
This package provides datasets for the textbook "Introduction to Sports
|
|
5
|
+
Analytics using Python" by Ryan Elmore.
|
|
6
|
+
|
|
7
|
+
Usage
|
|
8
|
+
-----
|
|
9
|
+
import isapy_data
|
|
10
|
+
|
|
11
|
+
# Load a dataset
|
|
12
|
+
df = isapy_data.load_data("masters")
|
|
13
|
+
|
|
14
|
+
# List all available datasets
|
|
15
|
+
isapy_data.list_datasets()
|
|
16
|
+
|
|
17
|
+
# Get information about a dataset
|
|
18
|
+
isapy_data.describe("masters")
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
from importlib.resources import files
|
|
22
|
+
from pathlib import Path
|
|
23
|
+
from typing import Optional
|
|
24
|
+
|
|
25
|
+
import pandas as pd
|
|
26
|
+
|
|
27
|
+
__version__ = "0.1.0"
|
|
28
|
+
__author__ = "Ryan Elmore"
|
|
29
|
+
|
|
30
|
+
# Dataset descriptions
|
|
31
|
+
_DATASET_INFO = {
|
|
32
|
+
"avs_roster_2021": "Colorado Avalanche roster data for 2020-21 season",
|
|
33
|
+
"avs_roster_2022": "Colorado Avalanche roster data for 2021-22 season",
|
|
34
|
+
"avs_stats_2021": "Colorado Avalanche player statistics for 2020-21 season",
|
|
35
|
+
"avs_stats_2022": "Colorado Avalanche player statistics for 2021-22 season",
|
|
36
|
+
"dk_edm_col": "DraftKings data for Edmonton vs Colorado game",
|
|
37
|
+
"dk_lac_dal": "DraftKings data for LA Clippers vs Dallas game",
|
|
38
|
+
"dk_mem_utah": "DraftKings data for Memphis vs Utah game",
|
|
39
|
+
"dk_nyr_car": "DraftKings data for NY Rangers vs Carolina game",
|
|
40
|
+
"epl_gk_stats_2022": "English Premier League goalkeeper statistics for 2021-22 season",
|
|
41
|
+
"epl_gk_stats_2023": "English Premier League goalkeeper statistics for 2022-23 season",
|
|
42
|
+
"epl_gk_stats_2024": "English Premier League goalkeeper statistics for 2023-24 season",
|
|
43
|
+
"epl_gk_stats_2025": "English Premier League goalkeeper statistics for 2024-25 season",
|
|
44
|
+
"epl_player_stats_2022": "English Premier League player statistics for 2021-22 season",
|
|
45
|
+
"epl_player_stats_2023": "English Premier League player statistics for 2022-23 season",
|
|
46
|
+
"epl_player_stats_2024": "English Premier League player statistics for 2023-24 season",
|
|
47
|
+
"epl_player_stats_2025": "English Premier League player statistics for 2024-25 season",
|
|
48
|
+
"epl_team_stats": "English Premier League team statistics",
|
|
49
|
+
"epl_team_stats_2023": "English Premier League team statistics for 2022-23 season",
|
|
50
|
+
"epl_team_stats_2024": "English Premier League team statistics for 2023-24 season",
|
|
51
|
+
"epl_team_stats_2025": "English Premier League team statistics for 2024-25 season",
|
|
52
|
+
"masters": "Masters Tournament golf data",
|
|
53
|
+
"nba_adv_team_2021": "NBA advanced team statistics for 2020-21 season",
|
|
54
|
+
"nba_adv_team_2023": "NBA advanced team statistics for 2022-23 season",
|
|
55
|
+
"nba_adv_team_2024": "NBA advanced team statistics for 2023-24 season",
|
|
56
|
+
"nba_adv_team_2025": "NBA advanced team statistics for 2024-25 season",
|
|
57
|
+
"nba_ff_team_2021": "NBA four factors team statistics for 2020-21 season",
|
|
58
|
+
"nba_ff_team_2023": "NBA four factors team statistics for 2022-23 season",
|
|
59
|
+
"nba_ff_team_2024": "NBA four factors team statistics for 2023-24 season",
|
|
60
|
+
"nba_ff_team_2025": "NBA four factors team statistics for 2024-25 season",
|
|
61
|
+
"nba_games_2021": "NBA game results for 2020-21 season",
|
|
62
|
+
"nba_games_2023": "NBA game results for 2022-23 season",
|
|
63
|
+
"nba_games_2024": "NBA game results for 2023-24 season",
|
|
64
|
+
"nba_games_2025": "NBA game results for 2024-25 season",
|
|
65
|
+
"nba_nuggets_shots": "Denver Nuggets shot location data",
|
|
66
|
+
"nhl_data_hockey_reference": "NHL data from Hockey Reference",
|
|
67
|
+
"nhl_team_stats_2021": "NHL team statistics for 2020-21 season",
|
|
68
|
+
"nhl_team_stats_2022": "NHL team statistics for 2021-22 season",
|
|
69
|
+
"nwsl_player_stats": "NWSL player statistics",
|
|
70
|
+
"nwsl_player_stats_2023": "NWSL player statistics for 2023 season",
|
|
71
|
+
"nwsl_player_stats_2024": "NWSL player statistics for 2024 season",
|
|
72
|
+
"ow_golf_rankings": "Official World Golf Rankings data",
|
|
73
|
+
"pga_tournaments": "PGA Tour tournament data",
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
def _get_data_path() -> Path:
|
|
78
|
+
"""Get the path to the data directory."""
|
|
79
|
+
return files("isapy_data").joinpath("data")
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
def list_datasets() -> list[str]:
|
|
83
|
+
"""
|
|
84
|
+
List all available datasets.
|
|
85
|
+
|
|
86
|
+
Returns
|
|
87
|
+
-------
|
|
88
|
+
list[str]
|
|
89
|
+
Names of all available datasets.
|
|
90
|
+
|
|
91
|
+
Examples
|
|
92
|
+
--------
|
|
93
|
+
>>> import isapy_data
|
|
94
|
+
>>> isapy_data.list_datasets()
|
|
95
|
+
['avs_roster_2021', 'avs_roster_2022', ...]
|
|
96
|
+
"""
|
|
97
|
+
data_path = _get_data_path()
|
|
98
|
+
datasets = []
|
|
99
|
+
for f in data_path.iterdir():
|
|
100
|
+
if f.name.endswith(".csv"):
|
|
101
|
+
datasets.append(f.name.replace(".csv", ""))
|
|
102
|
+
return sorted(datasets)
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
def load_data(name: str) -> pd.DataFrame:
|
|
106
|
+
"""
|
|
107
|
+
Load a dataset by name.
|
|
108
|
+
|
|
109
|
+
Parameters
|
|
110
|
+
----------
|
|
111
|
+
name : str
|
|
112
|
+
The name of the dataset to load (without file extension).
|
|
113
|
+
|
|
114
|
+
Returns
|
|
115
|
+
-------
|
|
116
|
+
pd.DataFrame
|
|
117
|
+
The requested dataset as a pandas DataFrame.
|
|
118
|
+
|
|
119
|
+
Raises
|
|
120
|
+
------
|
|
121
|
+
ValueError
|
|
122
|
+
If the dataset name is not found.
|
|
123
|
+
|
|
124
|
+
Examples
|
|
125
|
+
--------
|
|
126
|
+
>>> import isapy_data
|
|
127
|
+
>>> masters = isapy_data.load_data("masters")
|
|
128
|
+
>>> masters.head()
|
|
129
|
+
"""
|
|
130
|
+
data_path = _get_data_path()
|
|
131
|
+
file_path = data_path.joinpath(f"{name}.csv")
|
|
132
|
+
|
|
133
|
+
if not file_path.is_file():
|
|
134
|
+
available = list_datasets()
|
|
135
|
+
if available:
|
|
136
|
+
raise ValueError(
|
|
137
|
+
f"Dataset '{name}' not found. Available datasets: {available}"
|
|
138
|
+
)
|
|
139
|
+
else:
|
|
140
|
+
raise ValueError(
|
|
141
|
+
f"Dataset '{name}' not found. No datasets are currently installed."
|
|
142
|
+
)
|
|
143
|
+
|
|
144
|
+
return pd.read_csv(file_path)
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
def describe(name: str) -> Optional[str]:
|
|
148
|
+
"""
|
|
149
|
+
Get a description of a dataset.
|
|
150
|
+
|
|
151
|
+
Parameters
|
|
152
|
+
----------
|
|
153
|
+
name : str
|
|
154
|
+
The name of the dataset.
|
|
155
|
+
|
|
156
|
+
Returns
|
|
157
|
+
-------
|
|
158
|
+
str or None
|
|
159
|
+
Description of the dataset, or None if not available.
|
|
160
|
+
|
|
161
|
+
Examples
|
|
162
|
+
--------
|
|
163
|
+
>>> import isapy_data
|
|
164
|
+
>>> isapy_data.describe("masters")
|
|
165
|
+
'Masters Tournament golf data'
|
|
166
|
+
"""
|
|
167
|
+
return _DATASET_INFO.get(name)
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
def info() -> None:
|
|
171
|
+
"""
|
|
172
|
+
Print information about all available datasets.
|
|
173
|
+
|
|
174
|
+
Examples
|
|
175
|
+
--------
|
|
176
|
+
>>> import isapy_data
|
|
177
|
+
>>> isapy_data.info()
|
|
178
|
+
"""
|
|
179
|
+
print("ISAPy: Data package for Introduction to Sports Analytics using Python")
|
|
180
|
+
print("=" * 70)
|
|
181
|
+
print(f"Version: {__version__}")
|
|
182
|
+
print(f"Authors: {__author__}")
|
|
183
|
+
print()
|
|
184
|
+
print("Available datasets:")
|
|
185
|
+
print("-" * 70)
|
|
186
|
+
|
|
187
|
+
datasets = list_datasets()
|
|
188
|
+
if not datasets:
|
|
189
|
+
print("No datasets currently installed.")
|
|
190
|
+
print("See the package documentation for instructions on adding data.")
|
|
191
|
+
return
|
|
192
|
+
|
|
193
|
+
for name in datasets:
|
|
194
|
+
desc = describe(name) or "No description available"
|
|
195
|
+
print(f" {name}: {desc}")
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
__all__ = [
|
|
199
|
+
"__version__",
|
|
200
|
+
"list_datasets",
|
|
201
|
+
"load_data",
|
|
202
|
+
"describe",
|
|
203
|
+
"info",
|
|
204
|
+
]
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"jersey_number","person_id","person_full_name","person_link","position_code","position_name","position_type","position_abbreviation"
|
|
2
|
+
42,8476312,"Josh Manson","/api/v1/people/8476312","D","Defenseman","Defenseman","D"
|
|
3
|
+
4,8481524,"Bowen Byram","/api/v1/people/8481524","D","Defenseman","Defenseman","D"
|
|
4
|
+
54,8476948,"Charles Hudon","/api/v1/people/8476948","L","Left Wing","Forward","LW"
|
|
5
|
+
75,8480846,"Sampo Ranta","/api/v1/people/8480846","L","Left Wing","Forward","LW"
|
|
6
|
+
93,8482147,"Jean-Luc Foudy","/api/v1/people/8482147","C","Center","Forward","C"
|
|
7
|
+
11,8471699,"Andrew Cogliano","/api/v1/people/8471699","C","Center","Forward","C"
|
|
8
|
+
43,8471794,"Darren Helm","/api/v1/people/8471794","C","Center","Forward","C"
|
|
9
|
+
6,8473446,"Erik Johnson","/api/v1/people/8473446","D","Defenseman","Defenseman","D"
|
|
10
|
+
17,8476779,"Brad Hunt","/api/v1/people/8476779","D","Defenseman","Defenseman","D"
|
|
11
|
+
56,8477073,"Kurtis MacDermid","/api/v1/people/8477073","D","Defenseman","Defenseman","D"
|
|
12
|
+
37,8477456,"J.T. Compher","/api/v1/people/8477456","L","Left Wing","Forward","LW"
|
|
13
|
+
62,8477476,"Artturi Lehkonen","/api/v1/people/8477476","L","Left Wing","Forward","LW"
|
|
14
|
+
29,8477492,"Nathan MacKinnon","/api/v1/people/8477492","C","Center","Forward","C"
|
|
15
|
+
13,8477501,"Valeri Nichushkin","/api/v1/people/8477501","R","Right Wing","Forward","RW"
|
|
16
|
+
88,8477971,"Andreas Englund","/api/v1/people/8477971","D","Defenseman","Defenseman","D"
|
|
17
|
+
7,8478038,"Devon Toews","/api/v1/people/8478038","D","Defenseman","Defenseman","D"
|
|
18
|
+
96,8478420,"Mikko Rantanen","/api/v1/people/8478420","R","Right Wing","Forward","RW"
|
|
19
|
+
9,8478542,"Evan Rodrigues","/api/v1/people/8478542","C","Center","Forward","C"
|
|
20
|
+
81,8478843,"Denis Malgin","/api/v1/people/8478843","C","Center","Forward","C"
|
|
21
|
+
49,8479398,"Samuel Girard","/api/v1/people/8479398","D","Defenseman","Defenseman","D"
|
|
22
|
+
8,8480069,"Cale Makar","/api/v1/people/8480069","D","Defenseman","Defenseman","D"
|
|
23
|
+
40,8480382,"Alexandar Georgiev","/api/v1/people/8480382","G","Goalie","Goalie","G"
|
|
24
|
+
39,8480925,"Pavel Francouz","/api/v1/people/8480925","G","Goalie","Goalie","G"
|
|
25
|
+
25,8481186,"Logan O'Connor","/api/v1/people/8481186","R","Right Wing","Forward","RW"
|
|
26
|
+
18,8481618,"Alex Newhook","/api/v1/people/8481618","C","Center","Forward","C"
|
|
27
|
+
59,8483570,"Ben Meyers","/api/v1/people/8483570","C","Center","Forward","C"
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"jersey_number","person_id","person_full_name","person_link","position_code","position_name","position_type","position_abbreviation"
|
|
2
|
+
20,8479525,"Ross Colton","/api/v1/people/8479525","C","Center","Forward","C"
|
|
3
|
+
75,8480846,"Sampo Ranta","/api/v1/people/8480846","L","Left Wing","Forward","LW"
|
|
4
|
+
4,8481524,"Bowen Byram","/api/v1/people/8481524","D","Defenseman","Defenseman","D"
|
|
5
|
+
93,8482147,"Jean-Luc Foudy","/api/v1/people/8482147","C","Center","Forward","C"
|
|
6
|
+
59,8483570,"Ben Meyers","/api/v1/people/8483570","C","Center","Forward","C"
|
|
7
|
+
3,8471677,"Jack Johnson","/api/v1/people/8471677","D","Defenseman","Defenseman","D"
|
|
8
|
+
11,8471699,"Andrew Cogliano","/api/v1/people/8471699","C","Center","Forward","C"
|
|
9
|
+
12,8475793,"Ryan Johansen","/api/v1/people/8475793","C","Center","Forward","C"
|
|
10
|
+
42,8476312,"Josh Manson","/api/v1/people/8476312","D","Defenseman","Defenseman","D"
|
|
11
|
+
56,8477073,"Kurtis MacDermid","/api/v1/people/8477073","D","Defenseman","Defenseman","D"
|
|
12
|
+
28,8477425,"Miles Wood","/api/v1/people/8477425","L","Left Wing","Forward","LW"
|
|
13
|
+
62,8477476,"Artturi Lehkonen","/api/v1/people/8477476","L","Left Wing","Forward","LW"
|
|
14
|
+
29,8477492,"Nathan MacKinnon","/api/v1/people/8477492","C","Center","Forward","C"
|
|
15
|
+
27,8477494,"Jonathan Drouin","/api/v1/people/8477494","L","Left Wing","Forward","LW"
|
|
16
|
+
13,8477501,"Valeri Nichushkin","/api/v1/people/8477501","R","Right Wing","Forward","RW"
|
|
17
|
+
42,8478028,"Fredrik Olofsson","/api/v1/people/8478028","L","Left Wing","Forward","LW"
|
|
18
|
+
7,8478038,"Devon Toews","/api/v1/people/8478038","D","Defenseman","Defenseman","D"
|
|
19
|
+
96,8478420,"Mikko Rantanen","/api/v1/people/8478420","R","Right Wing","Forward","RW"
|
|
20
|
+
15,8479362,"Riley Tufte","/api/v1/people/8479362","L","Left Wing","Forward","LW"
|
|
21
|
+
49,8479398,"Samuel Girard","/api/v1/people/8479398","D","Defenseman","Defenseman","D"
|
|
22
|
+
8,8480069,"Cale Makar","/api/v1/people/8480069","D","Defenseman","Defenseman","D"
|
|
23
|
+
40,8480382,"Alexandar Georgiev","/api/v1/people/8480382","G","Goalie","Goalie","G"
|
|
24
|
+
39,8480925,"Pavel Francouz","/api/v1/people/8480925","G","Goalie","Goalie","G"
|
|
25
|
+
25,8481186,"Logan O'Connor","/api/v1/people/8481186","R","Right Wing","Forward","RW"
|