djm / python-scrapyd-api

A Python wrapper for working with Scrapyd's API.
BSD 2-Clause "Simplified" License
268 stars 32 forks source link

New feature of checking the state of job on the basis of job id #1

Closed PramodBisht closed 9 years ago

PramodBisht commented 9 years ago

You can add new feature of notifying a user when the job is complete. For example, using job id person should be able to know if that job is completed or not. Put it in another way on the basis of job id person should be able to know if job is in (pending,running or finished)

Thanks

djm commented 9 years ago

Hi Pramod,

Thanks for the feature request. I think I understand what you're after - a kind of job status call..

e.g

>>> scrapyd.job_status('ab4...62e')
'running'  # or 'pending', 'finished'

Correct?

The wrapper was originally written as a 1:1 to the Scrapyd API itself but I think this does warrant an extra wrapper method because it's so useful. The list_jobs endpoint from Scrapyd has this functionality in theory but having to parse the response yourself to get an answer about job status is indeed a pain.

I'll look at implementing this asap.

djm commented 9 years ago

@PramodBisht Implemented this and released :)

Please see updated docs here: http://python-scrapyd-api.readthedocs.org/en/latest/usage.html#retrieve-the-status-of-a-specific-job

and release v0.2 on PyPI here: https://pypi.python.org/pypi/python-scrapyd-api

Cheers.

PramodBisht commented 9 years ago

@djm

Thanks