ffbot 1.2.11__tar.gz → 1.2.12__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.
- {ffbot-1.2.11 → ffbot-1.2.12}/PKG-INFO +29 -3
- ffbot-1.2.12/ffbot/constants.py +1 -0
- {ffbot-1.2.11 → ffbot-1.2.12}/ffbot/optimizer.py +5 -1
- {ffbot-1.2.11 → ffbot-1.2.12}/ffbot/scraper.py +6 -6
- {ffbot-1.2.11 → ffbot-1.2.12}/ffbot.egg-info/PKG-INFO +29 -3
- {ffbot-1.2.11 → ffbot-1.2.12}/ffbot.egg-info/SOURCES.txt +3 -1
- {ffbot-1.2.11 → ffbot-1.2.12}/pyproject.toml +1 -0
- {ffbot-1.2.11 → ffbot-1.2.12}/setup.py +8 -1
- ffbot-1.2.12/tests/test_optimizer.py +23 -0
- ffbot-1.2.12/tests/test_utils.py +14 -0
- ffbot-1.2.11/ffbot/constants.py +0 -1
- {ffbot-1.2.11 → ffbot-1.2.12}/LICENSE +0 -0
- {ffbot-1.2.11 → ffbot-1.2.12}/README.md +0 -0
- {ffbot-1.2.11 → ffbot-1.2.12}/ffbot/__init__.py +0 -0
- {ffbot-1.2.11 → ffbot-1.2.12}/ffbot/utils.py +0 -0
- {ffbot-1.2.11 → ffbot-1.2.12}/ffbot.egg-info/dependency_links.txt +0 -0
- {ffbot-1.2.11 → ffbot-1.2.12}/ffbot.egg-info/requires.txt +0 -0
- {ffbot-1.2.11 → ffbot-1.2.12}/ffbot.egg-info/top_level.txt +0 -0
- {ffbot-1.2.11 → ffbot-1.2.12}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: ffbot
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.12
|
|
4
4
|
Summary: Automate playing Yahoo Fantasy Football
|
|
5
5
|
Home-page: https://github.com/amarvin/fantasy-football-bot
|
|
6
6
|
Author: Alex Marvin
|
|
@@ -8,10 +8,36 @@ Author-email: alex.marvin@gmail.com
|
|
|
8
8
|
Keywords: fantasy-football bot yahoo
|
|
9
9
|
Classifier: Development Status :: 5 - Production/Stable
|
|
10
10
|
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Classifier: Programming Language :: Python
|
|
11
12
|
Classifier: Programming Language :: Python :: 3
|
|
12
|
-
|
|
13
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
19
|
+
Requires-Python: >=3.10
|
|
13
20
|
Description-Content-Type: text/markdown
|
|
14
21
|
License-File: LICENSE
|
|
22
|
+
Requires-Dist: beautifulsoup4
|
|
23
|
+
Requires-Dist: loguru
|
|
24
|
+
Requires-Dist: lxml
|
|
25
|
+
Requires-Dist: pandas
|
|
26
|
+
Requires-Dist: pulp
|
|
27
|
+
Requires-Dist: requests
|
|
28
|
+
Requires-Dist: tqdm
|
|
29
|
+
Requires-Dist: user_agent
|
|
30
|
+
Dynamic: author
|
|
31
|
+
Dynamic: author-email
|
|
32
|
+
Dynamic: classifier
|
|
33
|
+
Dynamic: description
|
|
34
|
+
Dynamic: description-content-type
|
|
35
|
+
Dynamic: home-page
|
|
36
|
+
Dynamic: keywords
|
|
37
|
+
Dynamic: license-file
|
|
38
|
+
Dynamic: requires-dist
|
|
39
|
+
Dynamic: requires-python
|
|
40
|
+
Dynamic: summary
|
|
15
41
|
|
|
16
42
|
# fantasy-football-bot (ffbot)
|
|
17
43
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
VERSION = "1.2.12"
|
|
@@ -21,7 +21,7 @@ IR_STATUSES = {
|
|
|
21
21
|
"O",
|
|
22
22
|
"PUP", # e.g. PUP-R
|
|
23
23
|
}
|
|
24
|
-
SOLVER_SETTINGS = PULP_CBC_CMD(msg=
|
|
24
|
+
SOLVER_SETTINGS = PULP_CBC_CMD(msg=False)
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
def optimize(df, week, team, positions):
|
|
@@ -335,6 +335,10 @@ def optimize(df, week, team, positions):
|
|
|
335
335
|
|
|
336
336
|
df_opt = pd.DataFrame(solutions, columns=solutions_headers)
|
|
337
337
|
df_opt = df_opt.round(2)
|
|
338
|
+
for col, dtype in df_opt.dtypes.items():
|
|
339
|
+
if dtype != "string":
|
|
340
|
+
# Allow missing values
|
|
341
|
+
df_opt[col] = df_opt[col].astype("object")
|
|
338
342
|
df_opt.fillna("", inplace=True)
|
|
339
343
|
logger.info("Optimizer finished")
|
|
340
344
|
return df_opt
|
|
@@ -14,7 +14,7 @@ from user_agent import generate_user_agent
|
|
|
14
14
|
|
|
15
15
|
# A public league for current week and player IDs
|
|
16
16
|
PUBLIC_LEAGUE = 101
|
|
17
|
-
PUBLIC_LEAGUE_IDP =
|
|
17
|
+
PUBLIC_LEAGUE_IDP = 216
|
|
18
18
|
SEARCH_PLAYER_GROUPS = ["QB", "WR", "RB", "TE", "K", "DEF"]
|
|
19
19
|
SEARCH_PLAYER_GROUPS_IDP = ["QB", "WR", "RB", "TE", "K", "D", "DB", "DL", "LB"]
|
|
20
20
|
|
|
@@ -130,16 +130,16 @@ def scrape(league, is_IDP: bool = False):
|
|
|
130
130
|
points = row2.get("Fan Pts")
|
|
131
131
|
if points is None:
|
|
132
132
|
continue
|
|
133
|
+
elif pd.isna(points) or points == "-":
|
|
134
|
+
# Bye week
|
|
135
|
+
row[week] = 0
|
|
136
|
+
# row[week + ' projection'] = 0
|
|
137
|
+
# row[week + ' actual'] = 0
|
|
133
138
|
elif points[0] == "*":
|
|
134
139
|
# Game hasn't occured yet
|
|
135
140
|
row[week] = float(points[1:])
|
|
136
141
|
# row[week + ' projection'] = float(points[1:])
|
|
137
142
|
# row[week + ' actual'] = np.nan
|
|
138
|
-
elif points == "-":
|
|
139
|
-
# Bye week
|
|
140
|
-
row[week] = 0
|
|
141
|
-
# row[week + ' projection'] = 0
|
|
142
|
-
# row[week + ' actual'] = 0
|
|
143
143
|
else:
|
|
144
144
|
# Game completed
|
|
145
145
|
row[week] = float(points)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: ffbot
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.12
|
|
4
4
|
Summary: Automate playing Yahoo Fantasy Football
|
|
5
5
|
Home-page: https://github.com/amarvin/fantasy-football-bot
|
|
6
6
|
Author: Alex Marvin
|
|
@@ -8,10 +8,36 @@ Author-email: alex.marvin@gmail.com
|
|
|
8
8
|
Keywords: fantasy-football bot yahoo
|
|
9
9
|
Classifier: Development Status :: 5 - Production/Stable
|
|
10
10
|
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Classifier: Programming Language :: Python
|
|
11
12
|
Classifier: Programming Language :: Python :: 3
|
|
12
|
-
|
|
13
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
19
|
+
Requires-Python: >=3.10
|
|
13
20
|
Description-Content-Type: text/markdown
|
|
14
21
|
License-File: LICENSE
|
|
22
|
+
Requires-Dist: beautifulsoup4
|
|
23
|
+
Requires-Dist: loguru
|
|
24
|
+
Requires-Dist: lxml
|
|
25
|
+
Requires-Dist: pandas
|
|
26
|
+
Requires-Dist: pulp
|
|
27
|
+
Requires-Dist: requests
|
|
28
|
+
Requires-Dist: tqdm
|
|
29
|
+
Requires-Dist: user_agent
|
|
30
|
+
Dynamic: author
|
|
31
|
+
Dynamic: author-email
|
|
32
|
+
Dynamic: classifier
|
|
33
|
+
Dynamic: description
|
|
34
|
+
Dynamic: description-content-type
|
|
35
|
+
Dynamic: home-page
|
|
36
|
+
Dynamic: keywords
|
|
37
|
+
Dynamic: license-file
|
|
38
|
+
Dynamic: requires-dist
|
|
39
|
+
Dynamic: requires-python
|
|
40
|
+
Dynamic: summary
|
|
15
41
|
|
|
16
42
|
# fantasy-football-bot (ffbot)
|
|
17
43
|
|
|
@@ -34,11 +34,18 @@ setup(
|
|
|
34
34
|
classifiers=[
|
|
35
35
|
"Development Status :: 5 - Production/Stable",
|
|
36
36
|
"License :: OSI Approved :: MIT License",
|
|
37
|
+
"Programming Language :: Python",
|
|
37
38
|
"Programming Language :: Python :: 3",
|
|
39
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
40
|
+
"Programming Language :: Python :: 3.10",
|
|
41
|
+
"Programming Language :: Python :: 3.11",
|
|
42
|
+
"Programming Language :: Python :: 3.12",
|
|
43
|
+
"Programming Language :: Python :: 3.13",
|
|
44
|
+
"Programming Language :: Python :: 3.14",
|
|
38
45
|
],
|
|
39
46
|
keywords="fantasy-football bot yahoo",
|
|
40
47
|
packages=find_packages(exclude=["contrib", "docs", "tests"]),
|
|
41
|
-
python_requires=">=3.
|
|
48
|
+
python_requires=">=3.10",
|
|
42
49
|
install_requires=get_requirements(),
|
|
43
50
|
extra_require={
|
|
44
51
|
"test": get_requirements("test"),
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import pandas as pd
|
|
2
|
+
|
|
3
|
+
import ffbot
|
|
4
|
+
|
|
5
|
+
from . import POSITIONS, SCRAPER_FILE, TEAM
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def test_optimize():
|
|
9
|
+
df, week = ffbot.load(SCRAPER_FILE)
|
|
10
|
+
assert week == 4
|
|
11
|
+
df_opt = ffbot.optimize(df, week, TEAM, POSITIONS)
|
|
12
|
+
desired_df_opt = """ Add Drop Total points Discounted points VOR
|
|
13
|
+
0 Player 200 (WR)
|
|
14
|
+
1 <current roster> 1723.27 420.2 515.9
|
|
15
|
+
2 Player 221 (TE) 6.11 0.58 -19.01
|
|
16
|
+
3 Player 143 (DEF) Player 101 (QB) -10.41 2.33 -16.19
|
|
17
|
+
4 Player 157 (K) Player 177 (K) 4.06 2.01 4.06
|
|
18
|
+
5 Player 162 (DEF) Player 140 (DEF) -1.62 0.64 -5.79
|
|
19
|
+
6 Player 135 (K) Player 59 (RB) 9.26 0.37 -39.68
|
|
20
|
+
7 Player 90 (WR) - Waivers (Jan 2) 9.45 3.23 17.22
|
|
21
|
+
8 Player 132 (WR) 0.0 0.0 0.0
|
|
22
|
+
9 Player 129 (QB) - Free Agent Player 174 (WR) 14.53 0.85 11.16""" # noqa: W291
|
|
23
|
+
assert df_opt.to_string() == desired_df_opt
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import pandas as pd
|
|
2
|
+
from pandas.testing import assert_frame_equal
|
|
3
|
+
|
|
4
|
+
import ffbot
|
|
5
|
+
|
|
6
|
+
from . import SCRAPER_FILE
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def test_load():
|
|
10
|
+
df, week = ffbot.load(SCRAPER_FILE)
|
|
11
|
+
desired_week = 4
|
|
12
|
+
assert week == desired_week
|
|
13
|
+
desired_df = pd.read_csv(SCRAPER_FILE)
|
|
14
|
+
assert_frame_equal(df, desired_df)
|
ffbot-1.2.11/ffbot/constants.py
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
VERSION = "1.2.11"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|