Skip to content

Commit

Permalink
1.5.15 release (#482)
Browse files Browse the repository at this point in the history
  • Loading branch information
Philmod authored Jun 30, 2023
1 parent 0f4fec0 commit 94423e3
Show file tree
Hide file tree
Showing 9 changed files with 114 additions and 198 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Changelog
====

#### 1.5.15
Release date: 6/30/23
* Add missing licenses for datasets
* Re-add option to pass dataset with `-d`
* Download / list files for a specific version of a dataset
* Documentation improvements

#### 1.5.14
Release date: 6/29/23
* Show the full error message from the API
Expand Down
67 changes: 39 additions & 28 deletions KaggleSwagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,11 @@ paths:
required: true
type: string
description: Dataset name
- in: query
name: datasetVersionNumber
required: false
type: string
description: Dataset version number
responses:
200:
description: Result
Expand Down Expand Up @@ -477,34 +482,6 @@ paths:
description: Error
schema:
$ref: '#/definitions/Error'
/datasets/view/{ownerSlug}/{datasetSlug}:
get:
tags:
- kaggle
summary: Show details about a dataset
operationId: DatasetsView
produces:
- application/json
parameters:
- in: path
name: ownerSlug
required: true
type: string
description: Dataset owner
- in: path
name: datasetSlug
required: true
type: string
description: Dataset name
responses:
200:
description: Result
schema:
$ref: '#/definitions/Result'
default:
description: Error
schema:
$ref: '#/definitions/Error'
/datasets/download/{ownerSlug}/{datasetSlug}:
get:
tags:
Expand Down Expand Up @@ -1562,6 +1539,23 @@ definitions:
- other
- reddit-api
- world-bank
- CC-BY-4.0
- CC-BY-NC-4.0
- PDDL
- CC-BY-3.0
- CC-BY-3.0-IGO
- US-Government-Works
- CC-BY-NC-SA-3.0-IGO
- CDLA-Permissive-1.0
- CDLA-Sharing-1.0
- CC-BY-ND-4.0
- CC-BY-NC-ND-4.0
- ODC-BY-1.0
- LGPL-3.0
- AGPL-3.0
- FDL-1.3
- EU-ODP-Legal-Notice
- apache-2.0
subtitle:
type: string
description: The subtitle to be set on the dataset
Expand Down Expand Up @@ -1723,6 +1717,23 @@ definitions:
- other
- reddit-api
- world-bank
- CC-BY-4.0
- CC-BY-NC-4.0
- PDDL
- CC-BY-3.0
- CC-BY-3.0-IGO
- US-Government-Works
- CC-BY-NC-SA-3.0-IGO
- CDLA-Permissive-1.0
- CDLA-Sharing-1.0
- CC-BY-ND-4.0
- CC-BY-NC-ND-4.0
- ODC-BY-1.0
- LGPL-3.0
- AGPL-3.0
- FDL-1.3
- EU-ODP-Legal-Notice
- apache-2.0
Collaborator:
type: object
required:
Expand Down
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ The command line tool supports the following commands:

```
kaggle competitions {list, files, download, submit, submissions, leaderboard}
kaggle datasets {list, files, download, create, version, init}
kaggle datasets {list, files, download, create, version, init, metadata, status}
kaggle kernels {list, init, push, pull, output, status}
kaggle models {get, list, init, create, delete, update}
kaggle models instances {get, init, create, delete, update}
Expand Down Expand Up @@ -270,7 +270,7 @@ Example:
usage: kaggle datasets files [-h] [-v] [dataset]
required arguments:
dataset Dataset URL suffix in format <owner>/<dataset-name> (use "kaggle datasets list" to show options)
dataset Dataset URL suffix in format <owner>/<dataset-name> (use "kaggle datasets list" to show options), or <owner>/<dataset-name>/<version-number> for a specific version
optional arguments:
-h, --help show this help message and exit
Expand All @@ -281,6 +281,8 @@ Example:

`kaggle datasets files zillow/zecon`

`kaggle datasets files zillow/zecon/3`

##### Download dataset files

```
Expand All @@ -289,7 +291,7 @@ usage: kaggle datasets download [-h] [-f FILE_NAME] [-p PATH] [-w] [--unzip]
[dataset]
required arguments:
dataset Dataset URL suffix in format <owner>/<dataset-name> (use "kaggle datasets list" to show options)
dataset Dataset URL suffix in format <owner>/<dataset-name> (use "kaggle datasets list" to show options), or <owner>/<dataset-name>/<version-number> for a specific version
optional arguments:
-h, --help show this help message and exit
Expand All @@ -308,6 +310,8 @@ Examples:

`kaggle datasets download zillow/zecon`

`kaggle datasets download zillow/zecon/3`

`kaggle datasets download zillow/zecon -f State_time_series.csv`

Please note that BigQuery datasets cannot be downloaded.
Expand Down Expand Up @@ -481,7 +485,7 @@ optional arguments:

Example:

`kaggle kernels init -p /path/to/kernel`
`kaggle kernels init -p /path/to/folder`

##### Push a kernel

Expand All @@ -496,7 +500,7 @@ optional arguments:

Example:

`kaggle kernels push -p /path/to/kernel`
`kaggle kernels push -p /path/to/folder`

##### Pull a kernel

Expand Down
107 changes: 5 additions & 102 deletions kaggle/api/kaggle_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1732,6 +1732,7 @@ def datasets_list_files(self, owner_slug, dataset_slug, **kwargs): # noqa: E501
:param async_req bool
:param str owner_slug: Dataset owner (required)
:param str dataset_slug: Dataset name (required)
:param str dataset_version_number: Dataset version number
:return: Result
If the method is called asynchronously,
returns the request thread.
Expand All @@ -1754,12 +1755,13 @@ def datasets_list_files_with_http_info(self, owner_slug, dataset_slug, **kwargs)
:param async_req bool
:param str owner_slug: Dataset owner (required)
:param str dataset_slug: Dataset name (required)
:param str dataset_version_number: Dataset version number
:return: Result
If the method is called asynchronously,
returns the request thread.
"""

all_params = ['owner_slug', 'dataset_slug'] # noqa: E501
all_params = ['owner_slug', 'dataset_slug', 'dataset_version_number'] # noqa: E501
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
Expand Down Expand Up @@ -1792,6 +1794,8 @@ def datasets_list_files_with_http_info(self, owner_slug, dataset_slug, **kwargs)
path_params['datasetSlug'] = params['dataset_slug'] # noqa: E501

query_params = []
if 'dataset_version_number' in params:
query_params.append(('datasetVersionNumber', params['dataset_version_number'])) # noqa: E501

header_params = {}

Expand Down Expand Up @@ -2036,107 +2040,6 @@ def datasets_upload_file_with_http_info(self, file_name, content_length, last_mo
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)

def datasets_view(self, owner_slug, dataset_slug, **kwargs): # noqa: E501
"""Show details about a dataset # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.datasets_view(owner_slug, dataset_slug, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str owner_slug: Dataset owner (required)
:param str dataset_slug: Dataset name (required)
:return: Result
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.datasets_view_with_http_info(owner_slug, dataset_slug, **kwargs) # noqa: E501
else:
(data) = self.datasets_view_with_http_info(owner_slug, dataset_slug, **kwargs) # noqa: E501
return data

def datasets_view_with_http_info(self, owner_slug, dataset_slug, **kwargs): # noqa: E501
"""Show details about a dataset # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.datasets_view_with_http_info(owner_slug, dataset_slug, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str owner_slug: Dataset owner (required)
:param str dataset_slug: Dataset name (required)
:return: Result
If the method is called asynchronously,
returns the request thread.
"""

all_params = ['owner_slug', 'dataset_slug'] # noqa: E501
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')

params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method datasets_view" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'owner_slug' is set
if ('owner_slug' not in params or
params['owner_slug'] is None):
raise ValueError("Missing the required parameter `owner_slug` when calling `datasets_view`") # noqa: E501
# verify the required parameter 'dataset_slug' is set
if ('dataset_slug' not in params or
params['dataset_slug'] is None):
raise ValueError("Missing the required parameter `dataset_slug` when calling `datasets_view`") # noqa: E501

collection_formats = {}

path_params = {}
if 'owner_slug' in params:
path_params['ownerSlug'] = params['owner_slug'] # noqa: E501
if 'dataset_slug' in params:
path_params['datasetSlug'] = params['dataset_slug'] # noqa: E501

query_params = []

header_params = {}

form_params = []
local_var_files = {}

body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501

# Authentication setting
auth_settings = ['basicAuth'] # noqa: E501

return self.api_client.call_api(
'/datasets/view/{ownerSlug}/{datasetSlug}', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='Result', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)

def delete_model(self, owner_slug, model_slug, **kwargs): # noqa: E501
"""Delete a model # noqa: E501
Expand Down
Loading

0 comments on commit 94423e3

Please sign in to comment.