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
15 changes: 14 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
Changelog
====

### 1.7.5.0.dev0
### 1.8.0

* Fix resumable download error (#865)
* Fix dataset version spec (#862)
* Add machine_shape to the metadata of kaggle kernels pull (#856)
* Add pagination options to models
* Add pagination options for submissions (#832)
* Add pagination options to list commands (#815)
* Add canonical aliases for push/pull (#787)
* Add parquet as a filter option (#786)
* Add variations as alt for instances (#784)
* Enable (and rename) synonyms i and v (#782)

### 1.7.5.0 (not released)

* Require Python 3.11.
* Add KernelExecutionType (#775)
Expand Down
26 changes: 4 additions & 22 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,30 +25,12 @@ IMPORTANT: We do not offer Python 2 support. Please ensure that you are using P

## API credentials

To use the Kaggle API, sign up for a Kaggle account at https://www.kaggle.com. Then go to the 'Account' tab of your user profile (`https://www.kaggle.com/<username>/account`) and select 'Create API Token'. This will trigger the download of `kaggle.json`, a file containing your API credentials.
Place this file in the location appropriate for your operating system:
* Linux: `$XDG_CONFIG_HOME/kaggle/kaggle.json` (defaults to `~/.config/kaggle/kaggle.json`). The path `~/.kaggle/kaggle.json` which was used by older versions of the tool is also still supported.
* Windows: `C:\Users\<Windows-username>\.kaggle\kaggle.json` - you can check the exact location, sans drive, with `echo %HOMEPATH%`.
* Other: `~/.kaggle/kaggle.json`
To use the Kaggle API, sign up for a Kaggle account at https://www.kaggle.com. Then go to the 'Account' tab of your user profile (`https://www.kaggle.com/<username>/account`) and select 'Generate New Token'. Copy the generated token and save it in an environment
variable named `KAGGLE_API_TOKEN` or place the value in a file named `~/.kaggle/access_token`. (The file may optionally have a `.txt` extension.)

You can define a shell environment variable `KAGGLE_CONFIG_DIR` to change this location to `$KAGGLE_CONFIG_DIR/kaggle.json` (on Windows it will be `%KAGGLE_CONFIG_DIR%\kaggle.json`).


For your security, ensure that other users of your computer do not have read access to your credentials. On Unix-based systems you can do this with the following command:

`chmod 600 ~/.config/kaggle/kaggle.json`

You can also choose to export your Kaggle username and token to the environment:

```bash
export KAGGLE_USERNAME=datadinosaur
export KAGGLE_KEY=xxxxxxxxxxxxxx
```
In addition, you can export any other configuration value that normally would be in
the `kaggle.json` in the format 'KAGGLE_<VARIABLE>' (note uppercase).
For example, if the file had the variable "proxy" you would export `KAGGLE_PROXY`
and it would be discovered by the client.
Note: If you already have a `~/.kaggle/kaggle.json` file with legacy API credentials, it will continue to work.

What's noteworthy is that now when generating new tokens you do not have to update existing token usage. The old tokens will continue to work; previously they expired when a new token was generated.

## Commands

Expand Down
25 changes: 4 additions & 21 deletions documentation/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,29 +26,12 @@ IMPORTANT: We do not offer Python 2 support. Please ensure that you are using P

### API credentials

To use the Kaggle API, sign up for a Kaggle account at https://www.kaggle.com. Then go to the 'Account' tab of your user profile (`https://www.kaggle.com/<username>/account`) and select 'Create API Token'. This will trigger the download of `kaggle.json`, a file containing your API credentials.
Place this file in the location appropriate for your operating system:
* Linux: `$XDG_CONFIG_HOME/kaggle/kaggle.json` (defaults to `~/.config/kaggle/kaggle.json`). The path `~/.kaggle/kaggle.json` which was used by older versions of the tool is also still supported.
* Windows: `C:\Users\<Windows-username>\.kaggle\kaggle.json` - you can check the exact location, sans drive, with `echo %HOMEPATH%`.
* Other: `~/.kaggle/kaggle.json`
To use the Kaggle API, sign up for a Kaggle account at https://www.kaggle.com. Then go to the 'Account' tab of your user profile (`https://www.kaggle.com/<username>/account`) and select 'Generate New Token'. Copy the generated token and save it in an environment
variable named `KAGGLE_API_TOKEN` or place the value in a file named `~/.kaggle/access_token`. (The file may optionally have a `.txt` extension.)

You can define a shell environment variable `KAGGLE_CONFIG_DIR` to change this location to `$KAGGLE_CONFIG_DIR/kaggle.json` (on Windows it will be `%KAGGLE_CONFIG_DIR%\kaggle.json`).
Note: If you already have a `~/.kaggle/kaggle.json` file with legacy API credentials, it will continue to work.


For your security, ensure that other users of your computer do not have read access to your credentials. On Unix-based systems you can do this with the following command:

`chmod 600 ~/.config/kaggle/kaggle.json`

You can also choose to export your Kaggle username and token to the environment:

```bash
export KAGGLE_USERNAME=datadinosaur
export KAGGLE_KEY=xxxxxxxxxxxxxx
```
In addition, you can export any other configuration value that normally would be in
the `kaggle.json` in the format 'KAGGLE_<VARIABLE>' (note uppercase).
For example, if the file had the variable "proxy" you would export `KAGGLE_PROXY`
and it would be discovered by the client.
What's noteworthy is that now when generating new tokens you do not have to update existing token usage. The old tokens will continue to work; previously they expired when a new token was generated.

## Tutorials

Expand Down
2 changes: 1 addition & 1 deletion src/kaggle/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import os
from kaggle.api.kaggle_api_extended import KaggleApi

__version__ = "1.7.5.0.dev1"
__version__ = "1.8.0"

enable_oauth = os.environ.get("KAGGLE_ENABLE_OAUTH") in ("1", "true", "yes")
api = KaggleApi(enable_oauth=enable_oauth)
Expand Down
2 changes: 1 addition & 1 deletion src/kagglesdk/kaggle_http_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def _init_session(self):
return self._session

self._session = requests.Session()
self._session.headers.update({"User-Agent": "kaggle-api/v1.7.0", "Content-Type": "application/json"}) # Was: V2
self._session.headers.update({"User-Agent": "kaggle-api/v1.8.0", "Content-Type": "application/json"}) # Was: V2

iap_token = self._get_iap_token_if_required()
if iap_token is not None:
Expand Down
Loading