Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pagination to screener requests #229

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "yahooquery"
version = "2.3.3"
version = "2.3.4"
description = "Python wrapper for an unofficial Yahoo Finance API"
authors = ["Doug Guthrie <[email protected]>"]
documentation = "https://yahooquery.dpguthrie.com"
Expand All @@ -15,8 +15,8 @@ pandas = "^2.0.3"
requests-futures = "^1.0.1"
tqdm = "^4.65.0"
lxml = "^4.9.3"
selenium = {version = "^4.10.0", optional = true}
webdriver-manager = {version = "^3.8.6", optional = true}
selenium = { version = "^4.10.0", optional = true }
webdriver-manager = { version = "^3.8.6", optional = true }

[tool.poetry.dev-dependencies]
pytest = "^7.4.0"
Expand Down
6 changes: 3 additions & 3 deletions yahooquery/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -730,6 +730,7 @@ class _YahooFinance(object):
"formatted": {"required": False, "default": False},
"scrIds": {"required": True, "default": None},
"count": {"required": False, "default": 25},
"start": {"required": False, "default": 0},
},
},
"company360": {
Expand Down Expand Up @@ -963,7 +964,7 @@ def country(self, country):
def default_query_params(self):
"""
Dictionary containing default query parameters that are sent with
each request. The dictionary contains four keys: lang, region,
each request. The dictionary contains four keys: lang, region,
corsDomain, and crumb

Notes
Expand All @@ -978,7 +979,7 @@ def default_query_params(self):
if self.crumb is not None:
params['crumb'] = self.crumb
return params


def login(self, username, password):
ys = YahooSelenium(username=username, password=password)
Expand Down Expand Up @@ -1216,4 +1217,3 @@ def _construct_data(self, json, response_field, **kwargs):
data = json
return data


4 changes: 2 additions & 2 deletions yahooquery/screener.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def available_screeners(self):
"""
return list(SCREENERS.keys())

def get_screeners(self, screen_ids, count=25):
def get_screeners(self, screen_ids, count=25, start=0):
"""Return list of predefined screeners from Yahoo Finance

Parameters:
Expand All @@ -76,4 +76,4 @@ def get_screeners(self, screen_ids, count=25):
"""
screen_ids = self._check_screen_ids(screen_ids)
scrIds = [SCREENERS[screener]["id"] for screener in screen_ids]
return self._get_data("screener", params={"scrIds": scrIds, "count": count})
return self._get_data("screener", params={"scrIds": scrIds, "count": count, "start": start})
Loading