Skip to content

Commit 6eb8d51

Browse files
authored
Merge pull request #177 from fastlabel/feature/dataset-license
add: license args in create_dataset method
2 parents aa9b0e4 + dd97a58 commit 6eb8d51

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2393,6 +2393,7 @@ Create a new dataset.
23932393
```python
23942394
dataset = client.create_dataset(
23952395
name="object-detection", # Only lowercase alphanumeric characters + hyphen is available
2396+
license="The MIT License" # Optional
23962397
)
23972398
```
23982399

@@ -2404,6 +2405,7 @@ See API docs for details.
24042405
{
24052406
'id': 'YOUR_DATASET_ID',
24062407
'name': 'object-detection',
2408+
'license': 'The MIT License',
24072409
'createdAt': '2022-10-31T02:20:00.248Z',
24082410
'updatedAt': '2022-10-31T02:20:00.248Z'
24092411
}

examples/create_dataset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44

55
client = fastlabel.Client()
66

7-
dataset = client.create_dataset(name="object-detection")
7+
dataset = client.create_dataset(name="object-detection", license="The MIT License")
88
pprint(dataset)

fastlabel/__init__.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3860,19 +3860,15 @@ def get_datasets(
38603860
params["limit"] = limit
38613861
return self.api.get_request(endpoint, params=params)
38623862

3863-
def create_dataset(
3864-
self,
3865-
name: str,
3866-
) -> dict:
3863+
def create_dataset(self, name: str, license: str = "") -> dict:
38673864
"""
38683865
Create a dataset.
38693866
38703867
name is name of your dataset. Only lowercase alphanumeric characters + hyphen is available (Required).
3868+
license is a license name of your dataset. (Optional)
38713869
"""
38723870
endpoint = "datasets"
3873-
payload = {
3874-
"name": name,
3875-
}
3871+
payload = {"name": name, "license": license}
38763872
return self.api.post_request(endpoint, payload=payload)
38773873

38783874
def update_dataset(

0 commit comments

Comments
 (0)