Skip to content

Commit

Permalink
feat: add status as a function on ScrapydClient
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Freist authored and jpmckinney committed Feb 12, 2025
1 parent f0ef38f commit 31be57f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions scrapyd_client/pyclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ def schedule(self, project: str, spider: str, args: list[tuple[str, str]] | None
response = self._post("schedule", data=[*args, ("project", project), ("spider", spider)])
return response["jobid"]

def status(self, jobid: str, project: str | None = None) -> dict:
params = {"job": jobid}
if project is not None:
params["project"] = project

return self._get("status", params)

def _get(self, basename: str, params=None):
if params is None:
params = {}
Expand Down

0 comments on commit 31be57f

Please sign in to comment.