![]() |
Protocol for pathlib.Path-like API.
Inherits From: ReadOnlyPath
, PurePath
tfds.core.ReadWritePath(
*args, **kwargs
)
See pathlib.Path documentation.
Attributes | |
---|---|
parent
|
|
parents
|
Methods
as_posix
as_posix() -> str
as_uri
as_uri() -> str
copy
@abc.abstractmethod
copy( dst:
tfds.core.PathLike
, overwrite: bool = False ) ->tfds.typing.T
Copy the current file to the given destination.
exists
@abc.abstractmethod
exists() -> bool
Returns True if self exists.
expanduser
expanduser() -> tfds.typing.T
Returns a new path with expanded ~
and ~user
constructs.
format
format(
*args, **kwargs
) -> tfds.typing.T
Apply str.format()
to the path.
glob
@abc.abstractmethod
glob( pattern: str ) -> Iterator[T]
Yielding all matching files (of any kind).
is_absolute
is_absolute() -> bool
is_dir
@abc.abstractmethod
is_dir() -> bool
Returns True if self is a dir.
is_file
is_file() -> bool
Returns True if self is a file.
is_relative_to
is_relative_to(
*other
) -> bool
Return True if the path is relative to another path or False.
is_reserved
is_reserved() -> bool
iterdir
@abc.abstractmethod
iterdir() -> Iterator[T]
Iterates over the directory.
joinpath
joinpath(
*other
) -> tfds.typing.T
match
match(
path_pattern: str
) -> bool
mkdir
@abc.abstractmethod
mkdir( mode: int = 511, parents: bool = False, exist_ok: bool = False ) -> None
Create a new directory at this given path.
open
@abc.abstractmethod
open( mode: str = 'r', encoding: Optional[str] = None, errors: Optional[str] = None, **kwargs ) -> typing.IO[AnyStr]
Opens the file.
read_bytes
read_bytes() -> bytes
Reads contents of self as bytes.
read_text
read_text(
encoding: Optional[str] = None
) -> str
Reads contents of self as bytes.
relative_to
relative_to(
*other
) -> tfds.typing.T
rename
@abc.abstractmethod
rename( target:
tfds.core.PathLike
) ->tfds.typing.T
Renames the path.
replace
@abc.abstractmethod
replace( target:
tfds.core.PathLike
) ->tfds.typing.T
Overwrites the destination path.
resolve
@abc.abstractmethod
resolve( strict: bool = False ) ->
tfds.typing.T
Returns the absolute path.
rglob
rglob(
pattern: str
) -> Iterator[T]
Yielding all matching files recursivelly (of any kind).
rmdir
@abc.abstractmethod
rmdir() -> None
Remove the empty directory at this given path.
rmtree
@abc.abstractmethod
rmtree() -> None
Remove the directory, including all sub-files.
touch
touch(
mode: int = 438, exist_ok: bool = True
) -> None
Create a file at this given path.
unlink
@abc.abstractmethod
unlink( missing_ok: bool = False ) -> None
Remove this file or symbolic link.
with_name
with_name(
name: str
) -> tfds.typing.T
with_suffix
with_suffix(
suffix: str
) -> tfds.typing.T
write_bytes
write_bytes(
data: bytes
) -> None
Writes content as bytes.
write_text
write_text(
data: str, encoding: Optional[str] = None, errors: Optional[str] = None
) -> None
Writes content as str.
__ge__
__ge__(
other: 'PurePath'
) -> bool
Return self>=value.
__gt__
__gt__(
other: 'PurePath'
) -> bool
Return self>value.
__le__
__le__(
other: 'PurePath'
) -> bool
Return self<=value.
__lt__
__lt__(
other: 'PurePath'
) -> bool
Return self<value.
__rtruediv__
__rtruediv__(
key: tfds.core.PathLike
) -> tfds.typing.T
__truediv__
__truediv__(
key: tfds.core.PathLike
) -> tfds.typing.T