github.com/NVIDIA/aistore@v1.3.23-0.20240517131212-7df6609be51d/python/aistore/sdk/ais_source.py (about)

     1  #
     2  # Copyright (c) 2023 - 2024, NVIDIA CORPORATION. All rights reserved.
     3  #
     4  from abc import ABC, abstractmethod
     5  from typing import Iterable
     6  from aistore.sdk.object import Object
     7  
     8  
     9  # pylint: disable=too-few-public-methods
    10  class AISSource(ABC):
    11      """
    12      Interface for all AIS class types providing access to AIS objects via URLs
    13      """
    14  
    15      @abstractmethod
    16      def list_all_objects_iter(self, prefix: str = "") -> Iterable[Object]:
    17          """
    18          Get an iterable of all the objects contained in this source (bucket, group, etc.)
    19  
    20          Args:
    21              prefix (str, optional): Only include objects with names matching this prefix
    22  
    23          Returns:
    24              Iterable over selected objects
    25          """
    26  
    27      @abstractmethod
    28      def list_urls(self, prefix: str = "", etl_name: str = None) -> Iterable[str]:
    29          """
    30          Get an iterable of full urls to reference the objects contained in this source (bucket, group, etc.)
    31          Args:
    32              prefix (str, optional): Only include objects with names matching this prefix
    33              etl_name (str, optional): Apply an ETL when retrieving object contents
    34  
    35          Returns:
    36              Iterable over selected object URLS
    37          """