epath.Path#
- class etils.epath.Path(*args: str | os.PathLike)[source]#
Bases:
pathlib.PurePosixPath
Abstract base class for pathlib.Path-like API.
See [pathlib.Path](https://docs.python.org/3/library/pathlib.html) documentation.
- is_relative_to(*other: str | os.PathLike) bool [source]#
Return True if the path is relative to another path or False.
- format(*args: Any, **kwargs: Any) etils.epath.abstract_path._T [source]#
Apply str.format() to the path.
- glob(pattern: str) Iterator[etils.epath.abstract_path._T] [source]#
Yields all matching files (of any kind).
- rglob(pattern: str) Iterator[etils.epath.abstract_path._T] [source]#
Yields all matching files recursively (of any kind).
- walk(*, top_down: bool = True, on_error: collections.abc.Callable[[OSError], object] | None = None) Iterator[tuple[etils.epath.abstract_path._T, list[str], list[str]]] [source]#
- expanduser() etils.epath.abstract_path._T [source]#
Returns a new path with expanded ~ and ~user constructs.
- open(mode: str = 'r', encoding: str | None = None, errors: str | None = None, **kwargs: Any) IO [source]#
Opens the file.
- mkdir(mode: int = 511, parents: bool = False, exist_ok: bool = False) None [source]#
Create a new directory at this given path.
- write_text(data: str, encoding: str | None = None, errors: str | None = None) int [source]#
Writes content as str.