diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a7cc85..2d50e36 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/docs/README.md b/docs/README.md index 11b75fe..ee4812d 100644 --- a/docs/README.md +++ b/docs/README.md @@ -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//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\\.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//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_' (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 diff --git a/documentation/intro.md b/documentation/intro.md index 4f9dad0..38c9214 100644 --- a/documentation/intro.md +++ b/documentation/intro.md @@ -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//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\\.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//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_' (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 diff --git a/src/kaggle/__init__.py b/src/kaggle/__init__.py index a1f46de..d6ddc7b 100644 --- a/src/kaggle/__init__.py +++ b/src/kaggle/__init__.py @@ -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) diff --git a/src/kagglesdk/kaggle_http_client.py b/src/kagglesdk/kaggle_http_client.py index eff4248..16390d5 100644 --- a/src/kagglesdk/kaggle_http_client.py +++ b/src/kagglesdk/kaggle_http_client.py @@ -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: