kaggle-cli icon indicating copy to clipboard operation
kaggle-cli copied to clipboard

no feedback if you haven't accepted competition rules

Open brandly opened this issue 7 years ago • 0 comments

the README mentions

Please note that you must accept the competition rules on the competition's page before running your commands.

but it would be nice if the CLI gave you feedback to point you in the right direction. for instance, when trying to submit to a competition without having accepted the rules, you'll get something like:

Expecting value: line 1 column 1 (char 0)

this is due to the JSON parsing failing here, since the response body is an HTML document:

https://github.com/floydwch/kaggle-cli/blob/3f6071f1feddb08d6babfcdfd5a90496ae8b26e6/kaggle_cli/submit.py#L73-L82

seems like you could wrap that up:

try:
    # ...response.json()
except ValueError:
    print('You must accept competition rules on the competition's page before submitting to the competition\n{}'.format(competition_url))

linking to the competition_url feels like a nice touch.

thanks for this CLI! 🌟

brandly avatar Jan 26 '18 03:01 brandly