amep.base.check_path#

amep.base.check_path(path: str, extension: str) tuple[str, str]#

Checks if the directory of a given path exists and separates between directory and file name.

Parameters:
  • path (str) – Path to check.

  • extension (str) – File extension of the given path.

Raises:
  • ValueError – Raised if an invalid file extension has been identified.

  • FileNotFoundError – Raised if the directory does not exist.

Returns:

  • directory (str) – Directory of the given path.

  • filename (str) – File name in the given path.