1818 from openml .estimation_procedures import OpenMLEstimationProcedure
1919 from openml .evaluations import OpenMLEvaluation
2020 from openml .flows .flow import OpenMLFlow
21+ from openml .runs .run import OpenMLRun
2122 from openml .setups .setup import OpenMLSetup
23+ from openml .tasks .task import TaskType
2224
2325
2426class DatasetAPI (ResourceAPI ):
@@ -191,6 +193,21 @@ class FlowAPI(ResourceAPI):
191193
192194 resource_type : ResourceType = ResourceType .FLOW
193195
196+ @abstractmethod
197+ def get (self , flow_id : int , * , reset_cache : bool = False ) -> OpenMLFlow : ...
198+
199+ @abstractmethod
200+ def list (
201+ self ,
202+ limit : int | None = None ,
203+ offset : int | None = None ,
204+ tag : str | None = None ,
205+ uploader : str | None = None ,
206+ ) -> pd .DataFrame : ...
207+
208+ @abstractmethod
209+ def exists (self , name : str , external_version : str ) -> int | bool : ...
210+
194211
195212class StudyAPI (ResourceAPI ):
196213 """Abstract API interface for study resources."""
@@ -214,6 +231,46 @@ class RunAPI(ResourceAPI):
214231
215232 resource_type : ResourceType = ResourceType .RUN
216233
234+ @abstractmethod
235+ def get (
236+ self ,
237+ run_id : int ,
238+ * ,
239+ reset_cache : bool = False ,
240+ ) -> OpenMLRun : ...
241+
242+ @abstractmethod
243+ def list ( # type: ignore[valid-type] # noqa: PLR0913
244+ self ,
245+ limit : int ,
246+ offset : int ,
247+ * ,
248+ ids : builtins .list [int ] | None = None ,
249+ task : builtins .list [int ] | None = None ,
250+ setup : builtins .list [int ] | None = None ,
251+ flow : builtins .list [int ] | None = None ,
252+ uploader : builtins .list [int ] | None = None ,
253+ study : int | None = None ,
254+ tag : str | None = None ,
255+ display_errors : bool = False ,
256+ task_type : TaskType | int | None = None ,
257+ ) -> pd .DataFrame : ...
258+
259+ @abstractmethod
260+ def download_text_file (
261+ self ,
262+ source : str ,
263+ * ,
264+ md5_checksum : str | None = None ,
265+ ) -> str : ...
266+
267+ @abstractmethod
268+ def file_id_to_url (
269+ self ,
270+ file_id : int ,
271+ filename : str | None = None ,
272+ ) -> str : ...
273+
217274
218275class SetupAPI (ResourceAPI ):
219276 """Abstract API interface for setup resources."""
0 commit comments