epath.register_path_cls

epath.register_path_cls#

etils.epath.register_path_cls(path_cls_or_uri_prefix: str | list[str] | tuple[str, ...]) Callable[[etils.epath.register._T], etils.epath.register._T][source]#
etils.epath.register_path_cls(path_cls_or_uri_prefix: etils.epath.register._T) etils.epath.register._T

Register the pathlib-like class.

@epath.register_path_cls('my_path://')
class MyPath(pathlib.PurePosixPath):
  ...

my_path = epath.Path('my_path://some-path')
assert isinstance(my_path, MyPath)
Parameters:

path_cls_or_uri_prefix – If a uri prefix is given, then passing calling tfds.core.as_path(‘prefix://path’) will call the decorated class.

Returns:

The decorator or decoratorated class