Fantasy public pull utilities
Project description
Roadmap: We are on A) Hybrid → see ROADMAP.md.
Releases: see RELEASING.md.
Roadmap: Currently on A) Hybrid. See ROADMAP.md.
Status: Continuous Integration (contracts + validation checks) passing ✅
fantasy-public-pull
Goal: Use ESPN private league endpoints only to discover league/team/roster, and use public endpoints to fetch week-by-week player stats for all players (regardless of roster), then join them when building reports.
Quickstart
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
mkdir -p data/raw data/processed
# place raw pulls in data/raw ; clean outputs go to data/processed
Local Development Safety Checks
This repo uses a shared .githooks/pre-push script to enforce style, lint, and contract tests before every push.
One-time setup per machine
# ensure hooks use the shared folder
git config core.hooksPath .githooks
# install pre-commit into your virtualenv (if not already)
pip install pre-commit
# (optional) verify everything runs cleanly
git commit --allow-empty -m "hook check"
git push
Docs
- See the full Documentation Index for developer setup, CLI usage, roadmap, and releasing.
Local guardrails (pre-push)
pip install -r requirements-dev.txt
git config core.hooksPath .githooks
# (optional) run once to build hook envs faster:
pre-commit run --all-files
The pre-push hook runs:
pre-commit(Black + Ruff) on your changes./scripts/ci.sh test(unit tests)./scripts/ci.sh contracts(contract tests)
Pushes are blocked if any step fails.
Reports
Once you’ve generated a joined season file (e.g., with pull_range), you can summarize it:
# regenerate joined data (offline sample weeks 1–3)
python -m fppull.cli.pull_range --season 2025 --weeks 1-3 --out-dir data/processed
# top players by total points
python -m fppull.cli.report_top --in data/processed/season_2025_joined.csv --top 15
# group by position
python -m fppull.cli.report_top --in data/processed/season_2025_joined.csv --group-by position --top 10
# group by team
python -m fppull.cli.report_top --in data/processed/season_2025_joined.csv --group-by team --top 10
# require a minimum number of distinct weeks (e.g., >= 2)
python -m fppull.cli.report_top --in data/processed/season_2025_joined.csv --group-by player --min-weeks 2 --top 20
# optionally write the table to CSV
python -m fppull.cli.report_top --in data/processed/season_2025_joined.csv --group-by team --out data/processed/top_teams.csv
## Make targets
Handy shortcuts for common tasks:
```bash
# Rebuild joined data and print a top summary (defaults: season=2025, weeks=1-3)
make report-top
# Variations:
make report-top season=2025 weeks=1-3
make report-top season=2025 group_by=team top=10
make report-top season=2025 group_by=position min_weeks=2
# Local checks
make test # unit tests
make contracts # contract tests
make lint # ruff
make fmt # black
make ci # fmt + lint + tests + contracts
### report_top formats & PPG
```bash
# table (default) + points per game
python -m fppull.cli.report_top --in data/processed/season_2025_joined.csv --top 10 --ppg
# CSV to stdout
python -m fppull.cli.report_top --in data/processed/season_2025_joined.csv --format csv --top 10
# JSON to file
python -m fppull.cli.report_top --in data/processed/season_2025_joined.csv --format json --ppg --top 10 --out data/processed/top10.json
[](https://pypi.org/project/fppull/)
[](https://github.com/Masen222/fantasy-public-pull/releases)
[](https://github.com/Masen222/fantasy-public-pull/actions/workflows/ci.yml)
## Install
```bash
pip install fppull
Artifacts map (what gets produced)
| Layer | How to run | Key outputs |
|---|---|---|
| Public stats | python -m fppull.cli.pull_range --season 2025 --weeks 1-3 --out-dir data/processed |
player_week_stats_long.csv, player_week_stats_wide.csv, player_week_points.csv |
| Private league context | (your private fetch or CSVs) | teams.csv, roster_week.csv, matchups.csv |
| Join + reports | `python -m fppull.cli.report_top --in data/processed/season_2025_joined.csv --top 15 [--group-by position | team]` |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fppull-0.2.1.tar.gz.
File metadata
- Download URL: fppull-0.2.1.tar.gz
- Upload date:
- Size: 303.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
79ec1d61ba6be47ed69a29ac463256a04d66004565525e82aaef18c6a22f5fcd
|
|
| MD5 |
30f016984f4e5424efe5609984fac3a2
|
|
| BLAKE2b-256 |
d34c95256d23e091d55c544d166b46678562cfd7b1fc313ef1662b972007a290
|
Provenance
The following attestation bundles were made for fppull-0.2.1.tar.gz:
Publisher:
publish-pypi.yml on Masen222/fantasy-public-pull
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fppull-0.2.1.tar.gz -
Subject digest:
79ec1d61ba6be47ed69a29ac463256a04d66004565525e82aaef18c6a22f5fcd - Sigstore transparency entry: 619541069
- Sigstore integration time:
-
Permalink:
Masen222/fantasy-public-pull@4ae055c8a652d3a2aa531ef6e24c91c3542dc5fe -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/Masen222
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@4ae055c8a652d3a2aa531ef6e24c91c3542dc5fe -
Trigger Event:
push
-
Statement type:
File details
Details for the file fppull-0.2.1-py3-none-any.whl.
File metadata
- Download URL: fppull-0.2.1-py3-none-any.whl
- Upload date:
- Size: 88.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
80d8f7bd4f6672107d7c031c84a6831fa934e897effae4ab8a699996b1e85ab0
|
|
| MD5 |
df2c263cbc2ecd02ad908997de196a85
|
|
| BLAKE2b-256 |
4e702522c691c84587acbf3ed39b28044844e403c25f0653fdba59db33f5aa15
|
Provenance
The following attestation bundles were made for fppull-0.2.1-py3-none-any.whl:
Publisher:
publish-pypi.yml on Masen222/fantasy-public-pull
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fppull-0.2.1-py3-none-any.whl -
Subject digest:
80d8f7bd4f6672107d7c031c84a6831fa934e897effae4ab8a699996b1e85ab0 - Sigstore transparency entry: 619541126
- Sigstore integration time:
-
Permalink:
Masen222/fantasy-public-pull@4ae055c8a652d3a2aa531ef6e24c91c3542dc5fe -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/Masen222
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@4ae055c8a652d3a2aa531ef6e24c91c3542dc5fe -
Trigger Event:
push
-
Statement type: