Source code for blissoda.utils.validators
from pathlib import Path
[docs]
def is_file(filename: str) -> str:
filepath = Path(filename)
if not filepath.exists():
raise ValueError(f"File {filename} does not exist")
if not filepath.is_file():
raise ValueError(f"{filename} is not a file")
return str(filepath)