Skip to content

Commit

Permalink
Merge branch 'main' into features
Browse files Browse the repository at this point in the history
  • Loading branch information
cooperdff authored Aug 7, 2021
2 parents 35b8f32 + 6704850 commit 37f7a4d
Show file tree
Hide file tree
Showing 14 changed files with 7,145 additions and 6 deletions.
58 changes: 52 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# nfl_data_py

nfl_data_py is a Python library for interacting with NFL data sourced from nflfastR (https://github.com/nflverse/nflfastR-data/) and nfldata (https://github.com/nflverse/nfldata/).
nfl_data_py is a Python library for interacting with NFL data sourced from [nflfastR](https://github.com/nflverse/nflfastR-data/), [nfldata](https://github.com/nflverse/nfldata/), [dynastyprocess](https://raw.githubusercontent.com/dynastyprocess/), and [Draft Scout](https://draftscout.com/).

Includes import functions for play-by-play data, weekly data, seasonal data, rosters, win totals, scoring lines, officials, draft picks, draft pick values, schedules, team descriptive info, combine results and id mappings across various sites.

## Installation

Expand All @@ -18,7 +20,7 @@ import nfl_data_py as nfl

**Working with play-by-play data**
```python
nfl.import_pbp_data(years, columns)
nfl.import_pbp_data(years, columns, downcast=True)
```
Returns play-by-play data for the years and columns specified

Expand All @@ -28,14 +30,17 @@ years
columns
: optional, list of columns to pull data for

downcast
: converts float64 columns to float32, reducing memory usage by ~30%. Will slow down initial load speed ~50%

```python
nfl.see_pbp_cols()
```
returns list of columns available in play-by-play dataset

**Working with weekly data**
```python
nfl.import_weekly_data(years, columns)
nfl.import_weekly_data(years, columns, downcast)
```
Returns weekly data for the years and columns specified

Expand All @@ -45,6 +50,9 @@ years
columns
: optional, list of columns to pull data for

downcast
: converts float64 columns to float32, reducing memory usage by ~30%. Will slow down initial load speed ~50%

```python
nfl.see_weekly_cols()
```
Expand All @@ -59,7 +67,7 @@ Returns seasonal data, including various calculated market share stats
years
: required, list of years to pull data for (earliest available is 1999)

**Importing roster data**
**Additional data imports**
```python
nfl.import_rosters(years, columns)
```
Expand All @@ -71,32 +79,35 @@ years
columns
: optional, list of columns to pull data for

**Other assorted data imports**
```python
nfl.import_win_totals(years)
```
Returns win total lines for years specified

years
: optional, list of years to pull

```python
nfl.import_sc_lines(years)
```
Returns scoring lines for years specified

years
: optional, list of years to pull

```python
nfl.import_officials(years)
```
Returns official information by game for the years specified

years
: optional, list of years to pull

```python
nfl.import_draft_picks()
nfl.import_draft_picks(years)
```
Returns list of draft picks for the years specified

years
: optional, list of years to pull

Expand All @@ -105,6 +116,41 @@ nfl.import_draft_values()
```
Returns relative values by generic draft pick according to various popular valuation methods

```python
nfl.import_team_desc()
```
Returns dataframe with color/logo/etc information for all NFL team

```python
nfl.import_schedules(years)
```
Returns dataframe with schedule information for years specified

years
: required, list of years to pull data for (earliest available is 1999)

```python
nfl.import_combine_data(years, positions)
```
Returns dataframe with combine results for years and positions specified

years
: optional, list or range of years to pull data from

positions
: optional, list of positions to be pulled (standard format - WR/QB/RB/etc.)

```python
nfl.import_ids(columns, ids)
```
Returns dataframe with mapped ids for all players across most major NFL and fantasy football data platforms

columns
: optional, list of columns to return

ids
: optional, list of ids to return

**Additional features**
```python
nfl.clean_nfl_data(df)
Expand Down
Loading

0 comments on commit 37f7a4d

Please sign in to comment.