Skip to main content

fantasy-football-bot (ffbot)

PyPI Latest Release PyPI downloads License Code style: black Imports: isort codecov

Automate playing Yahoo Fantasy Football

Installation

pip install ffbot

Usage

>>> import ffbot

Scrape player forecasts

To connect to your Yahoo league and team, you need your league ID and team ID. Visit your team at https://football.fantasysports.yahoo.com/f1/, and the url will also include your league and team ID.

>>> LEAGUE = 123456
>>> TEAM = 1
>>> POSITIONS = "QB, WR, WR, WR, RB, RB, TE, W/R/T, K, DEF, BN, BN, BN, BN, IR"
>>> week = ffbot.current_week()
>>> df = ffbot.scrape(LEAGUE)
>>> # If playing an Individual Defensive Player (IDP) league, then scrape additional players with:
>>> # df = ffbot.scrape(LEAGUE, is_IDP=True)
Scraping all QB...
Scraping all WR...
Scraping all RB...
Scraping all TE...
Scraping all K...
Scraping all DEF...
Scraping weekly forecasts...
Total runtime: 0:10:33.784455

Optional methods to save data to CSV, and load data:

>>> ffbot.save(df, week)
>>> df, week = ffbot.load()  # loads latest file, but you can also provide a filepath

Optimize add and drop players

ffbot.optimize() is used to find players to add and drop that maximize your team's performance. The optimizer decides which players to add and drop, and how to assign each player to positions each week. Optimization is repeated for current roster, for one player add/drop, two player add/drops, etc.

>>> df_opt = ffbot.optimize(df, week, TEAM, POSITIONS)
>>> print(df_opt)
                              Add              Drop Total points Discounted points     VOR
0                <current roster>                        1583.94            367.51  226.73
1                     Kansas City                          16.27              2.24   -7.98
2                     Matt Bryant         Joey Slye          4.6              1.67   -3.63
3                  Dede Westbrook      Kenyan Drake         4.27              0.65    2.75
4 Jordan Howard - Waivers (Oct 2)  Marvin Jones Jr.        10.37             17.23   -3.54

which means that optimal weekly rosters of your current players scores 1583.94 points across the season and 367.51 discounted points (points in week 1 are worth more than week 12). The best free agent to add is Kansas City, which increases discounted points by 2.24 (although lowers total season points by 16.27 and lowers value over replacement by 7.98). Two other free agent pickups improve discounted points. Only one Waiver claim (for Jordon Howard) increases discounted points.

Contribution

Please add Issues or submit Pull Requests!

For local development, install optional testing dependencies and pre-commit hooks using

pip install ffbot[test]
pre-commit install

Metadata

Release files for ffbot 1.2.12

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ffbot 1.2.12
File Size Uploaded
ffbot-1.2.12.tar.gz 11.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ffbot 1.2.12
File Interpreter ABI Platform
ffbot-1.2.12-py3-none-any.whl Python 3 none any Details

Total release size: 21.3 kB

Release files / ffbot-1.2.12.tar.gz

Download URL ffbot-1.2.12.tar.gz
Size 11.4 kB
Tags Source
SHA-256 checksum
How to use checksums
e6cedb194d9e2224c733b0440f7f745c5fbf18059ea13bd2be0be33bedd9681a
BLAKE2b-256 checksum
How to use checksums
200d8afbbe09d7e2f882b7ba68f4b8a288cbc7871cd5b07f28de3bd2d096fa95
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 1, 2026.

Transparency log

Release files / ffbot-1.2.12-py3-none-any.whl

Download URL ffbot-1.2.12-py3-none-any.whl
Size 9.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
aa89765b9f0d866e67d41e00a33a2a19cedb643a99c40d82fcace9f459a8ce68
BLAKE2b-256 checksum
How to use checksums
a0f043ac42ffcd10db3ab8ab8b21266cb5c1503140deba9bab880d64df8b9e64
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 1, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.2.12 This release

2 release files

1.2.10

2 release files

1.2.9

2 release files

1.2.8

2 release files

1.2.7

2 release files

1.2.6

2 release files

1.2.5

2 release files

1.2.4

2 release files

1.2.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.12

2 release files

1.0.11

2 release files

1.0.10

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.5

1 release file

1.0.4

1 release file

1.0.3

1 release file

1.0.2

1 release file

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page