base
openml._api.resources.base.base
#
ResourceAPI
#
ResourceAPI(http: HTTPClient, minio: MinIOClient)
Bases: ABC
Abstract base class for OpenML resource APIs.
This class defines the common interface for interacting with OpenML resources (e.g., datasets, flows, runs) across different API versions. Concrete subclasses must implement the resource-specific operations such as publishing, deleting, and tagging.
| PARAMETER | DESCRIPTION |
|---|---|
http
|
Configured HTTP client used for communication with the OpenML API.
TYPE:
|
minio
|
Configured MinIO client used for object storage operations.
TYPE:
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
api_version |
API version implemented by the resource.
TYPE:
|
resource_type |
Type of OpenML resource handled by the implementation.
TYPE:
|
_http |
Internal HTTP client instance.
TYPE:
|
_minio |
Internal MinIO client instance, if provided.
TYPE:
|
Source code in openml/_api/resources/base/base.py
delete
abstractmethod
#
Delete a resource by its identifier.
| PARAMETER | DESCRIPTION |
|---|---|
resource_id
|
Unique identifier of the resource to delete.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
|
Notes
Concrete subclasses must implement this method.
Source code in openml/_api/resources/base/base.py
publish
abstractmethod
#
Publish a new resource to the OpenML server.
| PARAMETER | DESCRIPTION |
|---|---|
path
|
API endpoint path used for publishing the resource.
TYPE:
|
files
|
Files or payload data required for publishing. The structure depends on the resource type.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
int
|
Identifier of the newly created resource. |
Notes
Concrete subclasses must implement this method.
Source code in openml/_api/resources/base/base.py
tag
abstractmethod
#
Add a tag to a resource.
| PARAMETER | DESCRIPTION |
|---|---|
resource_id
|
Identifier of the resource to tag.
TYPE:
|
tag
|
Tag to associate with the resource.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
list of str
|
Updated list of tags assigned to the resource. |
Notes
Concrete subclasses must implement this method.
Source code in openml/_api/resources/base/base.py
untag
abstractmethod
#
Remove a tag from a resource.
| PARAMETER | DESCRIPTION |
|---|---|
resource_id
|
Identifier of the resource to untag.
TYPE:
|
tag
|
Tag to remove from the resource.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
list of str
|
Updated list of tags assigned to the resource. |
Notes
Concrete subclasses must implement this method.