A module implementing utilities for working with different filesystems

eolearn.core.fs_utils.get_filesystem(path, create=False, config=None, **kwargs)[source]

A utility function for initializing any type of filesystem object with PyFilesystem2 package

  • path (str) – A filesystem path

  • create (bool) – If the filesystem path doesn’t exist this flag indicates to either create it or raise an error

  • config (SHConfig) – A configuration object with AWS credentials

  • kwargs – Any keyword arguments to be passed forward


A filesystem object

Return type


eolearn.core.fs_utils.get_base_filesystem_and_path(*path_parts, **kwargs)[source]

Parses multiple strings that define a filesystem path and returns a filesystem object with a relative path on the filesystem

  • path_parts (str) – One or more strings defining a filesystem path

  • kwargs – Parameters passed to get_filesystem function


A filesystem object and a relative path

Return type

(fs.FS, str)

eolearn.core.fs_utils.load_s3_filesystem(path, strict=False, config=None)[source]

Loads AWS s3 filesystem from a path

  • path (str) – A path to a folder on s3 bucket that will be the base folder in this filesystem

  • strict (bool) – If True the filesystem will be making additional checks to the s3. Default is False.

  • config (SHConfig or None) – A configuration object with AWS credentials. By default is set to None and in this case the default configuration will be taken.


A S3 filesystem object

Return type