_api
openml._api
#
APIBackend
#
Central backend for accessing all OpenML API resource interfaces.
This class provides a singleton interface to dataset, task, flow,
evaluation, run, setup, study, and other resource APIs. It also
manages configuration through a nested Config object and
allows dynamic retrieval and updating of configuration values.
| PARAMETER | DESCRIPTION |
|---|---|
config
|
Optional configuration object. If not provided, a default
TYPE:
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
dataset |
Interface for dataset-related API operations.
TYPE:
|
task |
Interface for task-related API operations.
TYPE:
|
evaluation_measure |
Interface for evaluation measure-related API operations.
TYPE:
|
estimation_procedure |
Interface for estimation procedure-related API operations.
TYPE:
|
evaluation |
Interface for evaluation-related API operations.
TYPE:
|
flow |
Interface for flow-related API operations.
TYPE:
|
study |
Interface for study-related API operations.
TYPE:
|
run |
Interface for run-related API operations.
TYPE:
|
setup |
Interface for setup-related API operations.
TYPE:
|
get_instance
classmethod
#
get_instance() -> APIBackend
Get the singleton instance of the APIBackend.
| RETURNS | DESCRIPTION |
|---|---|
APIBackend
|
Singleton instance of the backend. |
Source code in openml/_api/setup/backend.py
APIBackendBuilder
#
APIBackendBuilder(api_version: APIVersion, fallback_api_version: APIVersion | None = None)
Builder for constructing API backend instances with all resource-specific APIs.
This class organizes resource-specific API objects (datasets, tasks, flows, evaluations, runs, setups, studies, etc.) and provides a centralized access point for both the primary API version and an optional fallback API version.
The constructor automatically initializes:
- HTTPClient for the primary API version
- Optional HTTPClient for a fallback API version
- MinIOClient for file storage operations
- Resource-specific API instances, optionally wrapped with fallback proxies
| PARAMETER | DESCRIPTION |
|---|---|
api_version
|
The primary API version to use for all resource APIs and HTTP communication.
TYPE:
|
fallback_api_version
|
Optional fallback API version to wrap resource APIs with a FallbackProxy.
TYPE:
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
dataset |
API interface for dataset resources.
TYPE:
|
task |
API interface for task resources.
TYPE:
|
evaluation_measure |
API interface for evaluation measure resources.
TYPE:
|
estimation_procedure |
API interface for estimation procedure resources.
TYPE:
|
evaluation |
API interface for evaluation resources.
TYPE:
|
flow |
API interface for flow resources.
TYPE:
|
study |
API interface for study resources.
TYPE:
|
run |
API interface for run resources.
TYPE:
|
setup |
API interface for setup resources.
TYPE:
|
http_client |
Client for HTTP communication using the primary API version.
TYPE:
|
fallback_http_client |
Client for HTTP communication using the fallback API version, if provided.
TYPE:
|
minio_client |
Client for file storage operations (MinIO/S3).
TYPE:
|
Source code in openml/_api/setup/builder.py
DatasetAPI
#
DatasetAPI(http: HTTPClient, minio: MinIOClient)
Bases: ResourceAPI
Abstract API interface for dataset resources.
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.
Source code in openml/_api/resources/base/base.py
DatasetV1API
#
DatasetV1API(http: HTTPClient, minio: MinIOClient)
Bases: ResourceV1API, DatasetAPI
Version 1 API implementation for dataset resources.
Source code in openml/_api/resources/base/base.py
delete
#
Delete a resource using the V1 API.
| PARAMETER | DESCRIPTION |
|---|---|
resource_id
|
Identifier of the resource to delete.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
|
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the resource type is not supported for deletion. |
OpenMLNotAuthorizedError
|
If the user is not permitted to delete the resource. |
OpenMLServerError
|
If deletion fails for an unknown reason. |
OpenMLServerException
|
For other server-side errors. |
Source code in openml/_api/resources/base/versions.py
publish
#
Publish a new resource using the V1 API.
| PARAMETER | DESCRIPTION |
|---|---|
path
|
API endpoint path for the upload.
TYPE:
|
files
|
Files to upload as part of the request payload.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
int
|
Identifier of the newly created resource. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the server response does not contain a valid resource ID. |
OpenMLServerException
|
If the server returns an error during upload. |
Source code in openml/_api/resources/base/versions.py
tag
#
Add a tag to a resource using the V1 API.
| 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. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the resource type does not support tagging. |
OpenMLServerException
|
If the server returns an error. |
Source code in openml/_api/resources/base/versions.py
untag
#
Remove a tag from a resource using the V1 API.
| 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. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the resource type does not support tagging. |
OpenMLServerException
|
If the server returns an error. |
Source code in openml/_api/resources/base/versions.py
DatasetV2API
#
DatasetV2API(http: HTTPClient, minio: MinIOClient)
Bases: ResourceV2API, DatasetAPI
Version 2 API implementation for dataset resources.
Source code in openml/_api/resources/base/base.py
EstimationProcedureAPI
#
EstimationProcedureAPI(http: HTTPClient, minio: MinIOClient)
Bases: ResourceAPI
Abstract API interface for estimation procedure resources.
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.
Source code in openml/_api/resources/base/base.py
EstimationProcedureV1API
#
EstimationProcedureV1API(http: HTTPClient, minio: MinIOClient)
Bases: ResourceV1API, EstimationProcedureAPI
V1 API implementation for estimation procedures.
Fetches estimation procedures from the v1 XML API endpoint.
Source code in openml/_api/resources/base/base.py
delete
#
Delete a resource using the V1 API.
| PARAMETER | DESCRIPTION |
|---|---|
resource_id
|
Identifier of the resource to delete.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
|
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the resource type is not supported for deletion. |
OpenMLNotAuthorizedError
|
If the user is not permitted to delete the resource. |
OpenMLServerError
|
If deletion fails for an unknown reason. |
OpenMLServerException
|
For other server-side errors. |
Source code in openml/_api/resources/base/versions.py
list
#
list() -> list[OpenMLEstimationProcedure]
Return a list of all estimation procedures which are on OpenML.
| RETURNS | DESCRIPTION |
|---|---|
procedures
|
A list of all estimation procedures. Every procedure is represented by a dictionary containing the following information: id, task type id, name, type, repeats, folds, stratified.
TYPE:
|
Source code in openml/_api/resources/estimation_procedure.py
publish
#
Publish a new resource using the V1 API.
| PARAMETER | DESCRIPTION |
|---|---|
path
|
API endpoint path for the upload.
TYPE:
|
files
|
Files to upload as part of the request payload.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
int
|
Identifier of the newly created resource. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the server response does not contain a valid resource ID. |
OpenMLServerException
|
If the server returns an error during upload. |
Source code in openml/_api/resources/base/versions.py
tag
#
Add a tag to a resource using the V1 API.
| 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. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the resource type does not support tagging. |
OpenMLServerException
|
If the server returns an error. |
Source code in openml/_api/resources/base/versions.py
untag
#
Remove a tag from a resource using the V1 API.
| 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. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the resource type does not support tagging. |
OpenMLServerException
|
If the server returns an error. |
Source code in openml/_api/resources/base/versions.py
EstimationProcedureV2API
#
EstimationProcedureV2API(http: HTTPClient, minio: MinIOClient)
Bases: ResourceV2API, EstimationProcedureAPI
V2 API implementation for estimation procedures.
Fetches estimation procedures from the v2 JSON API endpoint.
Source code in openml/_api/resources/base/base.py
EvaluationAPI
#
EvaluationAPI(http: HTTPClient, minio: MinIOClient)
Bases: ResourceAPI
Abstract API interface for evaluation resources.
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.
Source code in openml/_api/resources/base/base.py
EvaluationMeasureAPI
#
EvaluationMeasureAPI(http: HTTPClient, minio: MinIOClient)
Bases: ResourceAPI
Abstract API interface for evaluation measure resources.
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.
Source code in openml/_api/resources/base/base.py
EvaluationMeasureV1API
#
EvaluationMeasureV1API(http: HTTPClient, minio: MinIOClient)
Bases: ResourceV1API, EvaluationMeasureAPI
V1 API implementation for evaluation measures.
Fetches evaluation measures from the v1 XML API endpoint.
Source code in openml/_api/resources/base/base.py
delete
#
Delete a resource using the V1 API.
| PARAMETER | DESCRIPTION |
|---|---|
resource_id
|
Identifier of the resource to delete.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
|
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the resource type is not supported for deletion. |
OpenMLNotAuthorizedError
|
If the user is not permitted to delete the resource. |
OpenMLServerError
|
If deletion fails for an unknown reason. |
OpenMLServerException
|
For other server-side errors. |
Source code in openml/_api/resources/base/versions.py
list
#
list() -> list[str]
List all evaluation measures available on OpenML.
| RETURNS | DESCRIPTION |
|---|---|
list[str]
|
A list of evaluation measure names. |
Source code in openml/_api/resources/evaluation_measure.py
publish
#
Publish a new resource using the V1 API.
| PARAMETER | DESCRIPTION |
|---|---|
path
|
API endpoint path for the upload.
TYPE:
|
files
|
Files to upload as part of the request payload.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
int
|
Identifier of the newly created resource. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the server response does not contain a valid resource ID. |
OpenMLServerException
|
If the server returns an error during upload. |
Source code in openml/_api/resources/base/versions.py
tag
#
Add a tag to a resource using the V1 API.
| 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. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the resource type does not support tagging. |
OpenMLServerException
|
If the server returns an error. |
Source code in openml/_api/resources/base/versions.py
untag
#
Remove a tag from a resource using the V1 API.
| 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. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the resource type does not support tagging. |
OpenMLServerException
|
If the server returns an error. |
Source code in openml/_api/resources/base/versions.py
EvaluationMeasureV2API
#
EvaluationMeasureV2API(http: HTTPClient, minio: MinIOClient)
Bases: ResourceV2API, EvaluationMeasureAPI
V2 API implementation for evaluation measures.
Fetches evaluation measures from the v2 JSON API endpoint.
Source code in openml/_api/resources/base/base.py
list
#
list() -> list[str]
List all evaluation measures available on OpenML.
| RETURNS | DESCRIPTION |
|---|---|
list[str]
|
A list of evaluation measure names. |
Source code in openml/_api/resources/evaluation_measure.py
EvaluationV1API
#
EvaluationV1API(http: HTTPClient, minio: MinIOClient)
Bases: ResourceV1API, EvaluationAPI
V1 API implementation for evaluations. Fetches evaluations from the v1 XML API endpoint.
Source code in openml/_api/resources/base/base.py
delete
#
Delete a resource using the V1 API.
| PARAMETER | DESCRIPTION |
|---|---|
resource_id
|
Identifier of the resource to delete.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
|
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the resource type is not supported for deletion. |
OpenMLNotAuthorizedError
|
If the user is not permitted to delete the resource. |
OpenMLServerError
|
If deletion fails for an unknown reason. |
OpenMLServerException
|
For other server-side errors. |
Source code in openml/_api/resources/base/versions.py
list
#
list(limit: int, offset: int, *, function: str, tasks: list | None = None, setups: list | None = None, flows: list | None = None, runs: list | None = None, uploaders: list | None = None, study: int | None = None, sort_order: str | None = None, **kwargs: Any) -> list[OpenMLEvaluation]
Retrieve evaluations from the OpenML v1 XML API.
This method builds an evaluation query URL based on the provided filters, sends a request to the OpenML v1 endpoint, parses the XML response into a dictionary, and enriches the result with uploader usernames.
| PARAMETER | DESCRIPTION |
|---|---|
The
|
|
ones
|
|
limit
|
the number of evaluations to return
TYPE:
|
offset
|
the number of evaluations to skip, starting from the first
TYPE:
|
function
|
the evaluation function. e.g., predictive_accuracy
TYPE:
|
tasks
|
the list of task IDs
TYPE:
|
setups
|
the list of setup IDs
TYPE:
|
flows
|
the list of flow IDs
TYPE:
|
runs
|
the list of run IDs
TYPE:
|
uploaders
|
the list of uploader IDs
TYPE:
|
study
|
TYPE:
|
kwargs
|
Legal filter operators: tag, per_fold
TYPE:
|
sort_order
|
order of sorting evaluations, ascending ("asc") or descending ("desc")
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
list of OpenMLEvaluation objects
|
|
Notes
This method performs two API calls: 1. Fetches evaluation data from the specified endpoint 2. Fetches user information for all uploaders in the evaluation data
The user information is used to map uploader IDs to usernames.
Source code in openml/_api/resources/evaluation.py
publish
#
Publish a new resource using the V1 API.
| PARAMETER | DESCRIPTION |
|---|---|
path
|
API endpoint path for the upload.
TYPE:
|
files
|
Files to upload as part of the request payload.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
int
|
Identifier of the newly created resource. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the server response does not contain a valid resource ID. |
OpenMLServerException
|
If the server returns an error during upload. |
Source code in openml/_api/resources/base/versions.py
tag
#
Add a tag to a resource using the V1 API.
| 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. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the resource type does not support tagging. |
OpenMLServerException
|
If the server returns an error. |
Source code in openml/_api/resources/base/versions.py
untag
#
Remove a tag from a resource using the V1 API.
| 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. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the resource type does not support tagging. |
OpenMLServerException
|
If the server returns an error. |
Source code in openml/_api/resources/base/versions.py
EvaluationV2API
#
EvaluationV2API(http: HTTPClient, minio: MinIOClient)
Bases: ResourceV2API, EvaluationAPI
V2 API implementation for evaluations. Fetches evaluations from the v2 json API endpoint.
Source code in openml/_api/resources/base/base.py
list
#
list(limit: int, offset: int, *, function: str, tasks: list | None = None, setups: list | None = None, flows: list | None = None, runs: list | None = None, uploaders: list | None = None, study: int | None = None, sort_order: str | None = None, **kwargs: Any) -> list[OpenMLEvaluation]
Retrieve evaluation results from the OpenML v2 JSON API.
Notes
This method is not yet implemented.
Source code in openml/_api/resources/evaluation.py
FallbackProxy
#
Proxy object that provides transparent fallback across multiple API versions.
This class delegates attribute access to a sequence of API implementations.
When a callable attribute is invoked and raises OpenMLNotSupportedError,
the proxy automatically attempts the same method on subsequent API instances
until one succeeds.
| PARAMETER | DESCRIPTION |
|---|---|
*api_versions
|
One or more API implementation instances ordered by priority. The first API is treated as the primary implementation, and subsequent APIs are used as fallbacks.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If no API implementations are provided. |
Notes
Attribute lookup is performed dynamically via __getattr__.
Only methods that raise OpenMLNotSupportedError trigger fallback
behavior. Other exceptions are propagated immediately.
Source code in openml/_api/resources/base/fallback.py
__getattr__
#
Dynamically resolve attribute access across API implementations.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
Name of the attribute being accessed.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Any
|
The resolved attribute. If it is callable, a wrapped function providing fallback behavior is returned. |
| RAISES | DESCRIPTION |
|---|---|
AttributeError
|
If none of the API implementations define the attribute. |
Source code in openml/_api/resources/base/fallback.py
FlowAPI
#
FlowAPI(http: HTTPClient, minio: MinIOClient)
Bases: ResourceAPI
Abstract API interface for flow resources.
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.
Source code in openml/_api/resources/base/base.py
FlowV1API
#
FlowV1API(http: HTTPClient, minio: MinIOClient)
Bases: ResourceV1API, FlowAPI
Version 1 API implementation for flow resources.
Source code in openml/_api/resources/base/base.py
delete
#
Delete a resource using the V1 API.
| PARAMETER | DESCRIPTION |
|---|---|
resource_id
|
Identifier of the resource to delete.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
|
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the resource type is not supported for deletion. |
OpenMLNotAuthorizedError
|
If the user is not permitted to delete the resource. |
OpenMLServerError
|
If deletion fails for an unknown reason. |
OpenMLServerException
|
For other server-side errors. |
Source code in openml/_api/resources/base/versions.py
publish
#
Publish a new resource using the V1 API.
| PARAMETER | DESCRIPTION |
|---|---|
path
|
API endpoint path for the upload.
TYPE:
|
files
|
Files to upload as part of the request payload.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
int
|
Identifier of the newly created resource. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the server response does not contain a valid resource ID. |
OpenMLServerException
|
If the server returns an error during upload. |
Source code in openml/_api/resources/base/versions.py
tag
#
Add a tag to a resource using the V1 API.
| 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. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the resource type does not support tagging. |
OpenMLServerException
|
If the server returns an error. |
Source code in openml/_api/resources/base/versions.py
untag
#
Remove a tag from a resource using the V1 API.
| 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. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the resource type does not support tagging. |
OpenMLServerException
|
If the server returns an error. |
Source code in openml/_api/resources/base/versions.py
FlowV2API
#
FlowV2API(http: HTTPClient, minio: MinIOClient)
Bases: ResourceV2API, FlowAPI
Version 2 API implementation for flow resources.
Source code in openml/_api/resources/base/base.py
HTTPCache
#
Filesystem-based cache for HTTP responses.
This class stores HTTP responses on disk using a structured directory layout
derived from the request URL and parameters. Each cached response consists of
three files: metadata (meta.json), headers (headers.json), and the raw
body (body.bin).
Notes
The cache key is derived from the URL (domain and path components) and query
parameters, excluding the api_key parameter.
get_key
#
Generate a filesystem-safe cache key for a request.
The key is constructed from URL path segments and
URL-encoded query parameters (excluding api_key).
| PARAMETER | DESCRIPTION |
|---|---|
url
|
The full request URL.
TYPE:
|
params
|
Query parameters associated with the request.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
A relative path string representing the cache key. |
Source code in openml/_api/clients/http.py
load
#
Load a cached HTTP response from disk.
| PARAMETER | DESCRIPTION |
|---|---|
key
|
Cache key identifying the stored response.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Response
|
Reconstructed response object with status code, headers, body, and metadata. |
| RAISES | DESCRIPTION |
|---|---|
FileNotFoundError
|
If the cache entry or required files are missing. |
ValueError
|
If required metadata is missing or malformed. |
Source code in openml/_api/clients/http.py
save
#
Persist an HTTP response to disk.
| PARAMETER | DESCRIPTION |
|---|---|
key
|
Cache key identifying where to store the response.
TYPE:
|
response
|
Response object to cache.
TYPE:
|
Notes
The response body is stored as binary data. Headers and metadata (status code, URL, reason, encoding, elapsed time, request info, and creation timestamp) are stored as JSON.
Source code in openml/_api/clients/http.py
HTTPClient
#
HTTPClient(*, api_version: APIVersion)
HTTP client for interacting with the OpenML API.
This client supports configurable retry policies, optional filesystem caching, API key authentication, and response validation including checksum verification.
| PARAMETER | DESCRIPTION |
|---|---|
api_version
|
Backend API Version.
TYPE:
|
Source code in openml/_api/clients/http.py
__request
#
__request(session: Session, method: str, url: str, params: Mapping[str, Any], data: Mapping[str, Any], headers: Mapping[str, str], files: Mapping[str, Any] | None, **request_kwargs: Any) -> tuple[Response | None, Exception | None]
Execute a single HTTP request attempt.
| PARAMETER | DESCRIPTION |
|---|---|
session
|
Active session used to send the request.
TYPE:
|
method
|
HTTP method (e.g.,
TYPE:
|
url
|
Full request URL.
TYPE:
|
params
|
Query parameters.
TYPE:
|
data
|
Request body data.
TYPE:
|
headers
|
HTTP headers.
TYPE:
|
files
|
Files to upload.
TYPE:
|
**request_kwargs
|
Additional arguments forwarded to
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
tuple of (requests.Response or None, Exception or None)
|
Response and potential retry exception. |
Source code in openml/_api/clients/http.py
delete
#
Send a DELETE request.
| PARAMETER | DESCRIPTION |
|---|---|
path
|
API path relative to the base URL.
TYPE:
|
**request_kwargs
|
Additional request arguments.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Response
|
HTTP response. |
Source code in openml/_api/clients/http.py
download
#
download(url: str, handler: Callable[[Response, Path, str], None] | None = None, encoding: str = 'utf-8', file_name: str = 'response.txt', md5_checksum: str | None = None) -> Path
Download a resource and store it in the cache directory.
| PARAMETER | DESCRIPTION |
|---|---|
url
|
Absolute URL of the resource to download.
TYPE:
|
handler
|
Custom handler function accepting
TYPE:
|
encoding
|
Text encoding used when writing the response body.
TYPE:
|
file_name
|
Name of the saved file.
TYPE:
|
md5_checksum
|
Expected MD5 checksum for integrity verification.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Path
|
Path to the downloaded file. |
| RAISES | DESCRIPTION |
|---|---|
OpenMLHashException
|
If checksum verification fails. |
Source code in openml/_api/clients/http.py
get
#
get(path: str, *, enable_cache: bool = False, refresh_cache: bool = False, use_api_key: bool = False, md5_checksum: str | None = None, **request_kwargs: Any) -> Response
Send a GET request.
| PARAMETER | DESCRIPTION |
|---|---|
path
|
API path relative to the base URL.
TYPE:
|
enable_cache
|
Whether to use the response cache.
TYPE:
|
refresh_cache
|
Whether to ignore existing cached entries.
TYPE:
|
use_api_key
|
Whether to include the API key.
TYPE:
|
md5_checksum
|
Expected MD5 checksum for response validation.
TYPE:
|
**request_kwargs
|
Additional request arguments.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Response
|
HTTP response. |
Source code in openml/_api/clients/http.py
post
#
Send a POST request.
| PARAMETER | DESCRIPTION |
|---|---|
path
|
API path relative to the base URL.
TYPE:
|
use_api_key
|
Whether to include the API key.
TYPE:
|
**request_kwargs
|
Additional request arguments.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Response
|
HTTP response. |
Source code in openml/_api/clients/http.py
MinIOClient
#
Lightweight client configuration for interacting with a MinIO-compatible object storage service.
This class stores basic configuration such as a base filesystem path and default HTTP headers. It is intended to be extended with actual request or storage logic elsewhere.
| ATTRIBUTE | DESCRIPTION |
|---|---|
path |
Configured base path for storage operations.
TYPE:
|
headers |
Default HTTP headers, including a user-agent identifying the OpenML Python client version.
TYPE:
|
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.
Source code in openml/_api/resources/base/base.py
ResourceV1API
#
ResourceV1API(http: HTTPClient, minio: MinIOClient)
Bases: ResourceAPI
Version 1 implementation of the OpenML resource API.
This class provides XML-based implementations for publishing,
deleting, tagging, and untagging resources using the V1 API
endpoints. Responses are parsed using xmltodict.
Notes
V1 endpoints expect and return XML. Error handling follows the legacy OpenML server behavior and maps specific error codes to more descriptive exceptions where appropriate.
Source code in openml/_api/resources/base/base.py
delete
#
Delete a resource using the V1 API.
| PARAMETER | DESCRIPTION |
|---|---|
resource_id
|
Identifier of the resource to delete.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
|
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the resource type is not supported for deletion. |
OpenMLNotAuthorizedError
|
If the user is not permitted to delete the resource. |
OpenMLServerError
|
If deletion fails for an unknown reason. |
OpenMLServerException
|
For other server-side errors. |
Source code in openml/_api/resources/base/versions.py
publish
#
Publish a new resource using the V1 API.
| PARAMETER | DESCRIPTION |
|---|---|
path
|
API endpoint path for the upload.
TYPE:
|
files
|
Files to upload as part of the request payload.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
int
|
Identifier of the newly created resource. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the server response does not contain a valid resource ID. |
OpenMLServerException
|
If the server returns an error during upload. |
Source code in openml/_api/resources/base/versions.py
tag
#
Add a tag to a resource using the V1 API.
| 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. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the resource type does not support tagging. |
OpenMLServerException
|
If the server returns an error. |
Source code in openml/_api/resources/base/versions.py
untag
#
Remove a tag from a resource using the V1 API.
| 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. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the resource type does not support tagging. |
OpenMLServerException
|
If the server returns an error. |
Source code in openml/_api/resources/base/versions.py
ResourceV2API
#
ResourceV2API(http: HTTPClient, minio: MinIOClient)
Bases: ResourceAPI
Version 2 implementation of the OpenML resource API.
This class represents the V2 API for resources. Operations such as
publishing, deleting, tagging, and untagging are currently not
supported and will raise OpenMLNotSupportedError.
Source code in openml/_api/resources/base/base.py
RunAPI
#
RunAPI(http: HTTPClient, minio: MinIOClient)
Bases: ResourceAPI
Abstract API interface for run resources.
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.
Source code in openml/_api/resources/base/base.py
RunV1API
#
RunV1API(http: HTTPClient, minio: MinIOClient)
Bases: ResourceV1API, RunAPI
Version 1 API implementation for run resources.
Source code in openml/_api/resources/base/base.py
delete
#
Delete a resource using the V1 API.
| PARAMETER | DESCRIPTION |
|---|---|
resource_id
|
Identifier of the resource to delete.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
|
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the resource type is not supported for deletion. |
OpenMLNotAuthorizedError
|
If the user is not permitted to delete the resource. |
OpenMLServerError
|
If deletion fails for an unknown reason. |
OpenMLServerException
|
For other server-side errors. |
Source code in openml/_api/resources/base/versions.py
publish
#
Publish a new resource using the V1 API.
| PARAMETER | DESCRIPTION |
|---|---|
path
|
API endpoint path for the upload.
TYPE:
|
files
|
Files to upload as part of the request payload.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
int
|
Identifier of the newly created resource. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the server response does not contain a valid resource ID. |
OpenMLServerException
|
If the server returns an error during upload. |
Source code in openml/_api/resources/base/versions.py
tag
#
Add a tag to a resource using the V1 API.
| 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. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the resource type does not support tagging. |
OpenMLServerException
|
If the server returns an error. |
Source code in openml/_api/resources/base/versions.py
untag
#
Remove a tag from a resource using the V1 API.
| 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. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the resource type does not support tagging. |
OpenMLServerException
|
If the server returns an error. |
Source code in openml/_api/resources/base/versions.py
RunV2API
#
RunV2API(http: HTTPClient, minio: MinIOClient)
Bases: ResourceV2API, RunAPI
Version 2 API implementation for run resources.
Source code in openml/_api/resources/base/base.py
SetupAPI
#
SetupAPI(http: HTTPClient, minio: MinIOClient)
Bases: ResourceAPI
Abstract API interface for setup resources.
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.
Source code in openml/_api/resources/base/base.py
SetupV1API
#
SetupV1API(http: HTTPClient, minio: MinIOClient)
Bases: ResourceV1API, SetupAPI
V1 XML API implementation for setups.
Source code in openml/_api/resources/base/base.py
delete
#
Delete a resource using the V1 API.
| PARAMETER | DESCRIPTION |
|---|---|
resource_id
|
Identifier of the resource to delete.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
|
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the resource type is not supported for deletion. |
OpenMLNotAuthorizedError
|
If the user is not permitted to delete the resource. |
OpenMLServerError
|
If deletion fails for an unknown reason. |
OpenMLServerException
|
For other server-side errors. |
Source code in openml/_api/resources/base/versions.py
exists
#
exists(flow: OpenMLFlow, param_settings: list[dict[str, Any]]) -> int | bool
Checks whether a hyperparameter configuration already exists on the server.
| PARAMETER | DESCRIPTION |
|---|---|
flow
|
The openml flow object. Should have flow id present for the main flow and all subflows (i.e., it should be downloaded from the server by means of flow.get, and not instantiated locally)
TYPE:
|
list
|
A list of dicts, where each dict has the following entries: oml:name : str: The OpenML parameter name oml:value : mixed: A representation of the parameter value oml:component : int: flow id to which the parameter belongs
|
| RETURNS | DESCRIPTION |
|---|---|
setup_id
|
setup id iff exists, False otherwise
TYPE:
|
Source code in openml/_api/resources/setup.py
get
#
get(setup_id: int) -> OpenMLSetup
Downloads the setup (configuration) description from OpenML and returns a structured object
| PARAMETER | DESCRIPTION |
|---|---|
setup_id
|
The Openml setup_id
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
OpenMLSetup
|
An initialized OpenMLSetup object parsed from the XML |
Source code in openml/_api/resources/setup.py
list
#
list(limit: int, offset: int, *, setup: Iterable[int] | None = None, flow: int | None = None, tag: str | None = None) -> list[OpenMLSetup]
Perform API call /setup/list/{filters}
| PARAMETER | DESCRIPTION |
|---|---|
The
|
|
filters
|
|
limit
|
TYPE:
|
offset
|
TYPE:
|
setup
|
TYPE:
|
flow
|
TYPE:
|
tag
|
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
list
|
setups that match the filters, going from id to the OpenMLSetup object. |
Source code in openml/_api/resources/setup.py
publish
#
Publish a new resource using the V1 API.
| PARAMETER | DESCRIPTION |
|---|---|
path
|
API endpoint path for the upload.
TYPE:
|
files
|
Files to upload as part of the request payload.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
int
|
Identifier of the newly created resource. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the server response does not contain a valid resource ID. |
OpenMLServerException
|
If the server returns an error during upload. |
Source code in openml/_api/resources/base/versions.py
tag
#
Add a tag to a resource using the V1 API.
| 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. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the resource type does not support tagging. |
OpenMLServerException
|
If the server returns an error. |
Source code in openml/_api/resources/base/versions.py
untag
#
Remove a tag from a resource using the V1 API.
| 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. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the resource type does not support tagging. |
OpenMLServerException
|
If the server returns an error. |
Source code in openml/_api/resources/base/versions.py
SetupV2API
#
SetupV2API(http: HTTPClient, minio: MinIOClient)
Bases: ResourceV2API, SetupAPI
V2 JSoN API implementation for setups.
Source code in openml/_api/resources/base/base.py
StudyAPI
#
StudyAPI(http: HTTPClient, minio: MinIOClient)
Bases: ResourceAPI
Abstract API interface for study resources.
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.
Source code in openml/_api/resources/base/base.py
StudyV1API
#
StudyV1API(http: HTTPClient, minio: MinIOClient)
Bases: ResourceV1API, StudyAPI
Version 1 API implementation for study resources.
Source code in openml/_api/resources/base/base.py
delete
#
Delete a resource using the V1 API.
| PARAMETER | DESCRIPTION |
|---|---|
resource_id
|
Identifier of the resource to delete.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
|
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the resource type is not supported for deletion. |
OpenMLNotAuthorizedError
|
If the user is not permitted to delete the resource. |
OpenMLServerError
|
If deletion fails for an unknown reason. |
OpenMLServerException
|
For other server-side errors. |
Source code in openml/_api/resources/base/versions.py
publish
#
Publish a new resource using the V1 API.
| PARAMETER | DESCRIPTION |
|---|---|
path
|
API endpoint path for the upload.
TYPE:
|
files
|
Files to upload as part of the request payload.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
int
|
Identifier of the newly created resource. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the server response does not contain a valid resource ID. |
OpenMLServerException
|
If the server returns an error during upload. |
Source code in openml/_api/resources/base/versions.py
tag
#
Add a tag to a resource using the V1 API.
| 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. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the resource type does not support tagging. |
OpenMLServerException
|
If the server returns an error. |
Source code in openml/_api/resources/base/versions.py
untag
#
Remove a tag from a resource using the V1 API.
| 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. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the resource type does not support tagging. |
OpenMLServerException
|
If the server returns an error. |
Source code in openml/_api/resources/base/versions.py
StudyV2API
#
StudyV2API(http: HTTPClient, minio: MinIOClient)
Bases: ResourceV2API, StudyAPI
Version 2 API implementation for study resources.
Source code in openml/_api/resources/base/base.py
TaskAPI
#
TaskAPI(http: HTTPClient, minio: MinIOClient)
Bases: ResourceAPI
Abstract API interface for task resources.
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.
Source code in openml/_api/resources/base/base.py
TaskV1API
#
TaskV1API(http: HTTPClient, minio: MinIOClient)
Bases: ResourceV1API, TaskAPI
Version 1 API implementation for task resources.
Source code in openml/_api/resources/base/base.py
delete
#
Delete a resource using the V1 API.
| PARAMETER | DESCRIPTION |
|---|---|
resource_id
|
Identifier of the resource to delete.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
|
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the resource type is not supported for deletion. |
OpenMLNotAuthorizedError
|
If the user is not permitted to delete the resource. |
OpenMLServerError
|
If deletion fails for an unknown reason. |
OpenMLServerException
|
For other server-side errors. |
Source code in openml/_api/resources/base/versions.py
publish
#
Publish a new resource using the V1 API.
| PARAMETER | DESCRIPTION |
|---|---|
path
|
API endpoint path for the upload.
TYPE:
|
files
|
Files to upload as part of the request payload.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
int
|
Identifier of the newly created resource. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the server response does not contain a valid resource ID. |
OpenMLServerException
|
If the server returns an error during upload. |
Source code in openml/_api/resources/base/versions.py
tag
#
Add a tag to a resource using the V1 API.
| 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. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the resource type does not support tagging. |
OpenMLServerException
|
If the server returns an error. |
Source code in openml/_api/resources/base/versions.py
untag
#
Remove a tag from a resource using the V1 API.
| 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. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the resource type does not support tagging. |
OpenMLServerException
|
If the server returns an error. |
Source code in openml/_api/resources/base/versions.py
TaskV2API
#
TaskV2API(http: HTTPClient, minio: MinIOClient)
Bases: ResourceV2API, TaskAPI
Version 2 API implementation for task resources.