base_strategy
            FileRetrievalStrategy
¶
    
              Bases: ABC
Abstract base class for file retrieval strategies.
This class defines the interface for strategies that retrieve file paths based on certain criteria. Concrete implementations of this class should provide the logic for retrieving file paths.
Source code in src/cloe_nessy/file_utilities/strategies/base_strategy.py
                
            _matches_extension(file_name, extension)
  
      staticmethod
  
¶
    Determines if a file name ends with the specified extension.
This method checks whether the provided file name matches the given file extension. The comparison is case-insensitive.
If the extension is an empty string, it checks if the file name either does not contain a dot or ends with a dot,
which indicates a file with no extension. If the extension is None, it matches any file name regardless of extension.
If the extension contains a dot (e.g., ".txt"), it is compared directly against the end of the file name. Otherwise,
a dot is prefixed to the extension to create the expected file extension format (e.g., "txt" becomes ".txt").
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
| file_name | str | The name of the file to check. This is converted to lowercase for case-insensitive comparison. | required | 
| extension | str | None | The extension to match against. Can be a string with or without a leading dot. | required | 
Returns:
| Name | Type | Description | 
|---|---|---|
| bool | bool | True if the file name ends with the specified extension, False otherwise. | 
Source code in src/cloe_nessy/file_utilities/strategies/base_strategy.py
              
            get_file_paths(location, extension=None, search_subdirs=True, **kwargs)
  
      abstractmethod
      staticmethod
  
¶
    Retrieves a list of file paths based on the specified criteria.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
| location | str | The location to search for files. | required | 
| extension | str | None | The file extension to filter by. If None, no extension filtering is applied. If an empty string, it matches files with no extension. | None | 
| search_subdirs | bool | Whether to search in subdirectories. | True | 
| kwargs | Additional keyword arguments that may be used by concrete implementations | {} | 
Returns:
| Type | Description | 
|---|---|
| list[str] | list[str]: A list of file paths that match the specified criteria. |