ffbot 1.2.6__tar.gz → 1.2.8__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.6 → ffbot-1.2.8}/PKG-INFO +1 -1
- ffbot-1.2.8/ffbot/constants.py +1 -0
- {ffbot-1.2.6 → ffbot-1.2.8}/ffbot/scraper.py +11 -4
- {ffbot-1.2.6 → ffbot-1.2.8}/ffbot.egg-info/PKG-INFO +1 -1
- ffbot-1.2.6/ffbot/constants.py +0 -1
- {ffbot-1.2.6 → ffbot-1.2.8}/LICENSE +0 -0
- {ffbot-1.2.6 → ffbot-1.2.8}/README.md +0 -0
- {ffbot-1.2.6 → ffbot-1.2.8}/ffbot/__init__.py +0 -0
- {ffbot-1.2.6 → ffbot-1.2.8}/ffbot/optimizer.py +0 -0
- {ffbot-1.2.6 → ffbot-1.2.8}/ffbot/utils.py +0 -0
- {ffbot-1.2.6 → ffbot-1.2.8}/ffbot.egg-info/SOURCES.txt +0 -0
- {ffbot-1.2.6 → ffbot-1.2.8}/ffbot.egg-info/dependency_links.txt +0 -0
- {ffbot-1.2.6 → ffbot-1.2.8}/ffbot.egg-info/requires.txt +0 -0
- {ffbot-1.2.6 → ffbot-1.2.8}/ffbot.egg-info/top_level.txt +0 -0
- {ffbot-1.2.6 → ffbot-1.2.8}/pyproject.toml +0 -0
- {ffbot-1.2.6 → ffbot-1.2.8}/setup.cfg +0 -0
- {ffbot-1.2.6 → ffbot-1.2.8}/setup.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
VERSION = "1.2.8"
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import re
|
|
1
2
|
from datetime import datetime
|
|
2
3
|
from io import StringIO
|
|
3
4
|
|
|
@@ -127,8 +128,10 @@ def scrape(league, is_IDP: bool = False):
|
|
|
127
128
|
df2 = pd.read_html(StringIO(html))[0]
|
|
128
129
|
for _, row2 in df2.iterrows():
|
|
129
130
|
week = "Week {}".format(row2["Week"])
|
|
130
|
-
points = row2
|
|
131
|
-
if points
|
|
131
|
+
points = row2.get("Fan Pts")
|
|
132
|
+
if points is None:
|
|
133
|
+
continue
|
|
134
|
+
elif points[0] == "*":
|
|
132
135
|
# Game hasn't occured yet
|
|
133
136
|
row[week] = float(points[1:])
|
|
134
137
|
# row[week + ' projection'] = float(points[1:])
|
|
@@ -149,6 +152,9 @@ def scrape(league, is_IDP: bool = False):
|
|
|
149
152
|
tqdm.pandas(desc="Scraping weekly forecasts")
|
|
150
153
|
df = df.progress_apply(get_projections, axis=1)
|
|
151
154
|
|
|
155
|
+
# Remove players without projections
|
|
156
|
+
df = df[~pd.isna(df["Week 1"])]
|
|
157
|
+
|
|
152
158
|
# Reorder columns
|
|
153
159
|
columns = list(df.columns)
|
|
154
160
|
columns[2], columns[1] = columns[1], columns[2]
|
|
@@ -188,8 +194,9 @@ def current_week():
|
|
|
188
194
|
s.headers["User-Agent"] = generate_user_agent()
|
|
189
195
|
r = s.get(url)
|
|
190
196
|
soup = bs(r.text, "lxml")
|
|
191
|
-
|
|
192
|
-
|
|
197
|
+
matchups = soup.select_one("#matchupweek .matchups-body")
|
|
198
|
+
weeks = re.findall(r"Week (\d+)", matchups.text)
|
|
199
|
+
week = weeks[0]
|
|
193
200
|
week = int(week)
|
|
194
201
|
|
|
195
202
|
return week
|
ffbot-1.2.6/ffbot/constants.py
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
VERSION = "1.2.6"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|