class documentation

The required interface for providing traversable resources.

Method contents Return an iterable of entries in `package`.
Method files Return a Traversable object for the loaded package.
Method is_resource Return True if the named 'path' is a resource.
Method open_resource Return an opened, file-like object for binary reading.
Method resource_path Return the file system path to the specified resource.
def contents(self) -> Iterator[str]: (source)

Return an iterable of entries in `package`.

def is_resource(self, path: StrPath) -> bool: (source)

Return True if the named 'path' is a resource. Files are resources, directories are not.

def open_resource(self, resource: StrPath) -> io.BufferedReader: (source)

Return an opened, file-like object for binary reading. The 'resource' argument is expected to represent only a file name. If the resource cannot be found, FileNotFoundError is raised.

def resource_path(self, resource: Any) -> NoReturn: (source)

Return the file system path to the specified resource. The 'resource' argument is expected to represent only a file name. If the resource does not exist on the file system, raise FileNotFoundError.