File size: 5,357 Bytes
76d9c4f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
---
title: Dataset
version: EN
---

### read_dataset
```python
vessl.read_dataset(
   dataset_name: str, **kwargs
)
```
Read a dataset in the default organization. If you want to override the
default organization, then pass `organization_name` as `**kwargs`.

**Args**
* `dataset_name` (str) : Dataset name.

**Example**
```python
vessl.read_dataset(
   dataset_name="mnist",
)
```

----

## read_dataset_version
```python
vessl.read_dataset_version(
   dataset_id: int, dataset_version_hash: str, **kwargs
)
```
Read the specific version of dataset in the default organization. If you
want to override the default organization, then pass `organization_name` as
`**kwargs`.

**Args**
* `dataset_id` (int) : Dataset id.
* `dataset_version_hash` (str) : Dataset version hash.

**Example**
```python
vessl.read_dataset_version(
    dataset_id=1,
    dataset_version_hash="hash123"
)
```

----

## list_datasets
```python
vessl.list_datasets(
   **kwargs
)
```
List datasets in the default organization. If you want to override the
default organization, then pass `organization_name` as `**kwargs`.

**Example**
```
vessl.list_datasets()
```

----

## create_dataset
```python
vessl.create_dataset(
   dataset_name: str, description: str = None, is_version_enabled: bool = False,
   is_public: bool = False, external_path: str = None, aws_role_arn: str = None,
   version_path: str = None, **kwargs
)
```
Create a dataset in the default organization. If you want to override
the default organization, then pass `organization_name` as `**kwargs`.

**Args**
* `dataset_name` (str) : Dataset name.
* `description` (str) : dataset description. Defaults to None.
* `is_version_enabled` (bool) : True if a dataset versioning is set,
    False otherwise. Defaults to False.
* `is_public` (bool) : True if a dataset is source from a public bucket, False
    otherwise. Defaults to False.
* `external_path` (str) : AWS S3 or Google Cloud Storage bucket URL. Defaults
    to None.
* `aws_role_arn` (str) : AWS Role ARN to access S3. Defaults to None.
* `version_path` (str) : Versioning bucket path. Defaults to None.

**Example**
```python
vessl.create_dataset(
    dataset_name="mnist",
    is_public=True,
    external_path="s3://savvihub-public-apne2/mnist"
)
```

----

## list_dataset_volume_files
```python
vessl.list_dataset_volume_files(
   dataset_name: str, need_download_url: bool = False, path: str = '',
   recursive: bool = False, **kwargs
)
```
List dataset volume files in the default organization. If you want to
override the default organization, then pass `organization_name` as
`**kwargs`.

**Args**
* `dataset_name` (str) : Dataset name.
* `need_download_url` (bool) : True if you need a download URL, False
    otherwise. Defaults to False.
* `path` (str) : Directory path to list. Defaults to root(""),
* `recursive` (bool) : True if list files recursively, False otherwise.
    Defaults to False.

**Example**
```python
vessl.list_dataset_volume_files(
    dataset_name="mnist",
    recursive=True,
)
```

----

## upload_dataset_volume_file
```python
vessl.upload_dataset_volume_file(
   dataset_name: str, source_path: str, dest_path: str, **kwargs
)
```
Upload file to the dataset. If you want to override the default
organization, then pass `organization_name` as `**kwargs`.

**Args**
* `dataset_name` (str) : Dataset name.
* `source_path` (str) : Local source path.
* `dest_path` (str) : Destination path within the dataset.

**Example**
```python
vessl.upload_dataset_volume_file(
    dataset_name="mnist",
    source_path="test.csv",
    dest_path="train",
)
```

----

## download_dataset_volume_file
```python
vessl.download_dataset_volume_file(
   dataset_name: str, source_path: str, dest_path: str, **kwargs
)
```
Download file from the dataset. If you want to override the default
organization, then pass `organization_name` as `**kwargs`.

**Args**
* `dataset_name` (str) : Dataset name.
* `source_path` (str) : Source path within the dataset.
* `dest_path` (str) : Local destination path.

**Example**
```python
vessl.download_dataset_volume_file(
    dataset_name="mnist",
    source_path="train/test.csv",
    dest_path=".",
)
```

----

## copy_dataset_volume_file
```python
vessl.copy_dataset_volume_file(
   dataset_name: str, source_path: str, dest_path: str, **kwargs
)
```
Copy files within the same dataset. Noted that this is not supported for
externally sourced datasets like S3 or GCS. If you want to override the
default organization, then pass `organization_name` as `**kwargs`.

**Args**
* `dataset_name` (str) : Dataset name.
* `source_path` (str) : Source path within the dataset.
* `dest_path` (str) : Local destination path.

**Example**
```python
vessl.download_dataset_volume_file(
    dataset_name="mnist",
    source_path="train/test.csv",
    dest_path="test/test.csv",
)
```

----

## delete_dataset_volume_file
```python
vessl.delete_dataset_volume_file(
   dataset_name: str, path: str, **kwargs
)
```
Delete the dataset volume file. Noted that this is not supported for
externally sourced datasets like S3 or GCS. If you want to override the
default organization, then pass `organization_name` as `**kwargs`.

**Args**
* `dataset_name` (str) : Dataset name.
* `path` (str) : File path.

**Example**
```python
vessl.delete_dataset_volume_file(
    dataset_name="mnist",
    path="train/test.csv",
)
```