<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/datasets/blob/v4.9.10/tensorflow_datasets/core/download/download_manager.py#L68-L143) |

Configuration for [`tfds.core.DatasetBuilder.download_and_prepare`](https://www.tensorflow.org/datasets/api_docs/python/tfds/core/DatasetBuilder#download_and_prepare).

    tfds.download.DownloadConfig(
        extract_dir: (epath.PathLike | None) = None,
        manual_dir: (epath.PathLike | None) = None,
        download_mode: util.GenerateMode = util.GenerateMode.REUSE_DATASET_IF_EXISTS,
        compute_stats: util.ComputeStatsMode = https://www.tensorflow.org/datasets/api_docs/python/tfds/download/ComputeStatsMode#SKIP,
        max_examples_per_split: (int | None) = None,
        register_checksums: bool = False,
        force_checksums_validation: bool = False,
        beam_runner: (Any | None) = None,
        beam_options: (Any | None) = None,
        try_download_gcs: bool = True,
        verify_ssl: bool = True,
        override_max_simultaneous_downloads: (int | None) = None,
        num_shards: (int | None) = None,
        min_shard_size: int = shard_utils.DEFAULT_MIN_SHARD_SIZE,
        max_shard_size: int = shard_utils.DEFAULT_MAX_SHARD_SIZE,
        ignore_duplicates: bool = False,
        nondeterministic_order: bool = False
    )

<br />

<br />

<br />

| ## Attributes ||
|---|---|
| `extract_dir` | `str`, directory where extracted files are stored. Defaults to "/extracted". |
| `manual_dir` | `str`, read-only directory where manually downloaded/extracted data is stored. Defaults to `<download_dir>/manual`. |
| `download_mode` | [`tfds.GenerateMode`](https://www.tensorflow.org/datasets/api_docs/python/tfds/download/GenerateMode), how to deal with downloads or data that already exists. Defaults to `REUSE_DATASET_IF_EXISTS`, which will reuse both downloads and data if it already exists. |
| `compute_stats` | `tfds.download.ComputeStats`, whether to compute statistics over the generated data. Defaults to `AUTO`. |
| `max_examples_per_split` | `int`, optional max number of examples to write into each split (used for testing). If set to 0, only execute the `_split_generators` (download the original data), but skip `_generator_examples`. |
| `register_checksums` | `bool`, defaults to False. If True, checksum of downloaded files are recorded. |
| `force_checksums_validation` | `bool`, defaults to False. If True, raises an error if an URL do not have checksums. |
| `beam_runner` | Runner to pass to `beam.Pipeline`, only used for datasets based on Beam for the generation. |
| `beam_options` | `PipelineOptions` to pass to `beam.Pipeline`, only used for datasets based on Beam for the generation. |
| `try_download_gcs` | `bool`, defaults to True. If True, prepared dataset will be downloaded from GCS, when available. If False, dataset will be downloaded and prepared from scratch. |
| `verify_ssl` | `bool`, defaults to True. If True, will verify certificate when downloading dataset. |
| `override_max_simultaneous_downloads` | `int`, optional max number of simultaneous downloads. If set, it will override dataset builder and downloader default values. |
| `num_shards` | optional number of shards that should be created. If `None`, then the number of shards is computed based on the total size of the dataset and the min and max shard size. |
| `min_shard_size` | optional minimum shard size in bytes. If `None`, 64 MB is used. |
| `max_shard_size` | optional maximum shard size in bytes. If `None`, 1 GiB is used. |
| `ignore_duplicates` | whether to ignore duplicated examples with the same key. If there are multiple examples with the same key, the first one is kept. |
| `nondeterministic_order` | If True, it will not assure deterministic ordering when writing' examples to disk in the case of beam datasets. This might result in quicker dataset preparation. |

<br />

## Methods

### `get_shard_config`

[View source](https://github.com/tensorflow/datasets/blob/v4.9.10/tensorflow_datasets/core/download/download_manager.py#L134-L139)

    get_shard_config() -> shard_utils.ShardConfig

### `replace`

[View source](https://github.com/tensorflow/datasets/blob/v4.9.10/tensorflow_datasets/core/download/download_manager.py#L141-L143)

    replace(
        **kwargs
    ) -> DownloadConfig

Returns a copy with updated attributes.

<br />

<br />

<br />

| ## Class Variables ||
|---|---|
| beam_options | `None` |
| beam_runner | `None` |
| compute_stats | `<ComputeStatsMode.SKIP: 'skip'>` |
| download_mode | `<GenerateMode.REUSE_DATASET_IF_EXISTS: 'reuse_dataset_if_exists'>` |
| extract_dir | `None` |
| force_checksums_validation | `False` |
| ignore_duplicates | `False` |
| manual_dir | `None` |
| max_examples_per_split | `None` |
| max_shard_size | `1073741824` |
| min_shard_size | `67108864` |
| nondeterministic_order | `False` |
| num_shards | `None` |
| override_max_simultaneous_downloads | `None` |
| register_checksums | `False` |
| try_download_gcs | `True` |
| verify_ssl | `True` |

<br />