Nflreadpy logo

Nflreadpy

Community
WalrusQuant
nflreadpy

Load NFL schedules, play-by-play, rosters, and player or team statistics directly from nflverse with nflreadpy. Use for NFL acquisition, schema review, bounded snapshots, and preparing user-owned analysis artifacts.

Overview

PublisherWalrusQuant
Repositorysports-analytic-skills
Skill namenflreadpy
Stars
53
Forks
4
Bundled files
5
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 5 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by WalrusQuant on GitHub. Read the source before you install it.

Installation

Install the Nflreadpy AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/WalrusQuant/sports-analytic-skills/tree/main/skills/nflreadpy
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/WalrusQuant/sports-analytic-skills.git /tmp/sports-analytic-skills
mkdir -p .claude/skills
cp -r /tmp/sports-analytic-skills/skills/nflreadpy .claude/skills/nflreadpy
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Nflreadpy in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Nflreadpy on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Nflreadpy is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

nflreadpy / nflverse Loader

Outcome

Create a documented, user-owned NFL data artifact at the grain required by the analysis. Record seasons, loader function and arguments, retrieval time, installed package version, source release, schema, natural key, row count, filters, and transformations.

Use nflreadpy for acquisition. Do not let source loading silently define the analytical grain, prediction cutoff, or legal feature set.

When to use this skill

Use for NFL schedules and scores, play-by-play, rosters, player or team stats, snap counts, injuries, and other nflverse releases. For non-NFL sources use the appropriate public package. Use data-sources when the source is undecided and feature-rules before turning loaded fields into prospective predictors.

Installation

bash
python -m pip install nflreadpy polars pyarrow

The first retrieval may require network access. Record the package version and cache or snapshot any data used for a durable claim.

Release selection

NeedNarrow starting releaseTypical grainMain timing risk
Results or schedule modelschedulesgamefuture/unplayed and status rows
Play analysisplay-by-playplaypost-play fields and drive summaries
Player identityrostersplayer-team-season/weekcurrent roster used as history
Player performanceplayer statsplayer-week/game/seasonaggregation and availability cutoff
Participationsnap countsplayer-gameknown only after event
Availabilityinjuriesplayer-reportrevision time and report stage

Read references/nflverse_releases.md when choosing among releases. Select the narrowest source that contains the required fields; do not load all play-by-play seasons for a schedule-only question.

Direct loads

python
import nflreadpy as nfl

seasons = [2022, 2023, 2024]
schedules = nfl.load_schedules(seasons)
pbp = nfl.load_pbp([2024])
player_stats = nfl.load_player_stats(seasons)
rosters = nfl.load_rosters([2024])

Loader availability, return types, and schemas can change by release. Inspect the installed interface and one bounded result before assuming a function, column, dtype, or natural key.

python
import nflreadpy as nfl

print(getattr(nfl, "__version__", "unknown"))
print([name for name in dir(nfl) if name.startswith("load_")])

Acquisition workflow

  1. Lock question, analytical grain, seasons, and required fields.
  2. Choose the narrowest nflverse release.
  3. Load one season first and inspect object type, schema, row count, nulls, and key.
  4. Save an immutable raw snapshot before normalization or filtering.
  5. Identify schedule status values and distinguish scheduled, completed, postponed, canceled, and missing-score rows.
  6. Validate team codes, game identifiers, dates, weeks, seasons, and score units.
  7. Normalize in a separate derived artifact; preserve source columns or a mapping.
  8. Save Parquet plus a JSON or Markdown manifest.
  9. Validate the artifact at its intended grain and document known gaps.
  10. Hand the explicit saved artifact to EDA, feature, or modeling work.

Team-game contract

When deriving one row per team per game, require at least:

text
game_id, season, week, gameday, team, opponent, is_home,
game_type, points_for, points_against, won, tied, point_diff

Consider retaining status, season type, kickoff timestamp, neutral-site flag, overtime/tie indicators, and raw team identifiers. Completed non-tied games should yield two complementary rows: points and margin reverse, home flags oppose, and exactly one won value is true. For ties, both won values may be false, so preserve an explicit tied flag.

Read references/panel_contract.md before normalizing schedules into team-game rows. Preserve raw schedule rows so every derived row can be audited.

Validation checks

Raw game grain

  • requested seasons and season types are present;
  • game_id is unique or duplication is explained;
  • completed games have both teams and plausible scores;
  • home and away teams differ;
  • week, date, season, and status fields are internally consistent;
  • duplicate and missing rates are reported by season;
  • future or incomplete events are not mislabeled completed.

Derived team-game grain

  • exactly two rows per included contest;
  • team/opponent and home/away values are complementary;
  • points-for/against and margins reverse across the pair;
  • won, tied, and point_diff follow the documented label rule;
  • unique-game count is reported beside row count;
  • overall row-level win rate is interpreted as a construction property, not home advantage.

Joins

  • stable player/team/game identifiers are preferred over display names;
  • join cardinality and unmatched rates are checked;
  • roster, injury, and weekly tables use a documented as-of timestamp;
  • relocations and historical team abbreviations are mapped explicitly, not silently rewritten.

Sports-specific traps

  • Doubled-panel trap: overall win rate is approximately 0.5 because each game contributes opponent rows. Estimate home advantage from home rows.
  • Postgame feature trap: EPA, final score, snap share, and many summaries are known after the event. They require lagging or a different decision time.
  • Roster hindsight: a current roster is not a historical roster snapshot.
  • Week ordering: postponed games and rescheduling can make week labels differ from event-time order. Use timestamps for as-of features.
  • Ties: coding won == 0 for both teams is not equivalent to two losses.
  • Schema drift: columns and dtypes can change across releases or seasons; validate before concatenation.
  • Identifiers: display-name joins can duplicate or mismatch players; use IDs.

Snapshot manifest

Record:

text
source: nflverse via nflreadpy
package_version
loader_function_and_arguments
retrieval_timestamp_utc
requested_and_observed_seasons
raw_artifact_path_and_checksum
derived_artifact_path_and_checksum
grain_and_natural_key
row_and_unique_event_counts
filters_and_status_rule
schema_or_schema_path
transformations_and_identifier_mapping
known_gaps_and_validation_results

Hard constraints and integrity rules

  1. Prefer documented release loaders over ad-hoc scraping.
  2. Do not load broad play-by-play when schedules or stats suffice.
  3. Do not use raw post-event fields as pre-event predictors without as-of rules.
  4. Do not treat current rosters as historical.
  5. Do not train outcome models on incomplete events unless forecasting those future events is the explicitly separate purpose.
  6. Do not join on player names when stable IDs exist.
  7. Do not silently rewrite historical team codes or schemas.
  8. Do not model a doubled panel without accounting for paired contest rows.
  9. Snapshot the exact data used for claims.
  10. Never swallow a load/schema error and return an empty artifact as success.

Anti-patterns

  • pulling every play from every season for a game-score question;
  • using postgame EPA in a pre-kickoff model;
  • claiming home advantage from the full team-game panel's win rate;
  • joining current rosters to historical games;
  • concatenating seasons before checking schema drift;
  • retaining only normalized output with no source snapshot;
  • reporting only row count while hiding duplicate games;
  • retry loops that hammer public infrastructure or obscure failure.

Helpers

bash
python <path-to-nflreadpy>/scripts/smoke_load.py --season 2024

python <path-to-nflreadpy>/scripts/load_game_panel.py \
  --seasons 2023-2024 \
  --game-types REG \
  --raw-out data/nfl_schedules.parquet \
  --out data/nfl_team_games.parquet

python <path-to-nflreadpy>/scripts/describe_panel.py \
  --input data/nfl_team_games.parquet

All helpers parse --help before importing nflreadpy. The output files are user-owned and consumable by any dataframe or modeling tool. The panel helper defaults to regular-season (REG) games, records game_type on every derived row, and requires the requested scope to be verifiable from the source. Pass an explicit comma-separated scope such as REG,WC,DIV,CON,SB when postseason games belong in the analysis. The panel helper does not replace manifest review or decision-time feature validation.

Worked example

For a pregame home-advantage analysis, load schedules rather than play-by-play, retain completed regular-season games under an explicit status rule, save raw Parquet, derive paired team-game rows, and report both unique games and rows. Compute the home rate on is_home == 1; do not use the full-panel rate.

Output contract

Return artifact paths, source release, package version, retrieval timestamp, loader arguments, requested/observed seasons, grain, natural key, row and event counts, columns/schema, filters, transformations, known gaps, and sanity-check results. Name the next artifact consumer without requiring a particular project.

Resources

  • references/nflverse_releases.md — read when selecting the narrowest NFL release.
  • references/panel_contract.md — read before building or validating paired team-game rows.
  • scripts/smoke_load.py — bounded source probe.
  • scripts/load_game_panel.py — raw schedule to team-game export.
  • scripts/describe_panel.py — standalone panel validation and summary.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Nflreadpy AI skill do?

Load NFL schedules, play-by-play, rosters, and player or team statistics directly from nflverse with nflreadpy. Use for NFL acquisition, schema review, bounded snapshots, and preparing user-owned analysis artifacts.

Why use Nflreadpy on TypingMind?

Because you install it once and use it with any model. Nflreadpy is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Nflreadpy in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/WalrusQuant/sports-analytic-skills/tree/main/skills/nflreadpy. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Nflreadpy?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Nflreadpy?

As many as you like. As long as a model supports skills, you can use Nflreadpy with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Nflreadpy AI skill free?

Yes. It is published on GitHub by WalrusQuant under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇