TensorFlow 2.0 Beta is available Learn more

tfds.download.Resource

Class Resource

Represents a resource to download, extract, or both.

View source

__init__

View source

__init__(
    url=None,
    extract_method=None,
    path=None
)

Resource constructor.

Args:

  • url: str, the URL at which to download the resource.
  • extract_method: ExtractMethod to be used to extract resource. If not set, will be guessed from downloaded file name original_fname.
  • path: str, path of resource on local disk. Can be None if resource has not be downloaded yet. In such case, url must be set.

Properties

extract_method

Returns ExtractMethod to use on resource. Cannot be None.

Methods

exists_locally

View source

@classmethod
exists_locally(
    cls,
    path
)

Returns whether the resource exists locally, at resource.path.