Skip to content
Merged
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
__pycache__/
dist/
.idea
2 changes: 1 addition & 1 deletion kagglesdk/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.1.25"
__version__ = "0.1.26"

from kagglesdk.kaggle_client import KaggleClient
from kagglesdk.kaggle_creds import KaggleCredentials
Expand Down
12 changes: 8 additions & 4 deletions kagglesdk/kaggle_http_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,14 @@ def _get_apikey_creds():
if not kaggle_json or not kaggle_json.strip():
return None

api_key_data = json.loads(kaggle_json)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this relate to setting the config? I am not sure I follow. This seems it would prevent failure if the kaggle.json file is malformed.

kaggle config set -n competition -v <competition-slug>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now I get it, kaggle config set is saving it's value in kaggle.json.

username = api_key_data["username"]
api_key = api_key_data["key"]
return username, api_key
try:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a command here saying

kaggle config set saves value in the kaggle.json file. The credentials may not be available.

"Be careful, since the file may be used for more than credential storage."
api_key_data = json.loads(kaggle_json)
username = api_key_data["username"]
api_key = api_key_data["key"]
return username, api_key
except KeyError as e:
return None


class KaggleHttpClient(object):
Expand Down