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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2393,6 +2393,7 @@ Create a new dataset.
```python
dataset = client.create_dataset(
name="object-detection", # Only lowercase alphanumeric characters + hyphen is available
license="The MIT License" # Optional
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[IMO]
どこかに固定のライセンス一覧を記載しても良さそうです。
(ユーザからすると、何のライセンスがあるか分からない)

※ 公開どドキュメントに記載する場合は不要かも

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

こちら返信ないですが、対応方針はどうなりますか?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

公開ドキュメントで対応しようと思います。

)
```

Expand All @@ -2404,6 +2405,7 @@ See API docs for details.
{
'id': 'YOUR_DATASET_ID',
'name': 'object-detection',
'license': 'The MIT License',
'createdAt': '2022-10-31T02:20:00.248Z',
'updatedAt': '2022-10-31T02:20:00.248Z'
}
Expand Down
2 changes: 1 addition & 1 deletion examples/create_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@

client = fastlabel.Client()

dataset = client.create_dataset(name="object-detection")
dataset = client.create_dataset(name="object-detection", license="The MIT License")
pprint(dataset)
10 changes: 3 additions & 7 deletions fastlabel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3860,19 +3860,15 @@ def get_datasets(
params["limit"] = limit
return self.api.get_request(endpoint, params=params)

def create_dataset(
self,
name: str,
) -> dict:
def create_dataset(self, name: str, license: str = "") -> dict:
"""
Create a dataset.

name is name of your dataset. Only lowercase alphanumeric characters + hyphen is available (Required).
license is a license name of your dataset. (Optional)
"""
endpoint = "datasets"
payload = {
"name": name,
}
payload = {"name": name, "license": license}
return self.api.post_request(endpoint, payload=payload)

def update_dataset(
Expand Down