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