EnsuredSource

class EnsuredSource(path: Path)[source]

Bases: Source, ABC

A source that needs to be ensured before opening.

Attributes Summary

path

The local path where the resource is stored on disk.

Methods Summary

ensure()

Ensure the remote dataset is downloaded.

open()

Download the file and open it using polymorphism.

Attributes Documentation

Parameters:

path (Path)

path: Path = <dataclasses._MISSING_TYPE object>

The local path where the resource is stored on disk.

Methods Documentation

abstractmethod ensure() → None[source]

Ensure the remote dataset is downloaded.

Return type:

None

open() → Generator[IO[str]][source]

Download the file and open it using polymorphism.

Return type:

Generator[IO[str]]