# `HfHub.Extract`
[🔗](https://github.com/North-Shore-AI/hf_hub_ex/blob/v0.3.1/lib/hf_hub/extract.ex#L1)

Archive detection and extraction utilities.

# `archive_type`

```elixir
@type archive_type() :: :zip | :tar | :tar_gz | :tar_xz | :gz
```

# `default_extract_path`

```elixir
@spec default_extract_path(Path.t()) :: Path.t()
```

Returns the default extraction path for an archive.

For gzip files, this is the target file path.
For other archives, this is a directory path.

# `detect_archive_type`

```elixir
@spec detect_archive_type(Path.t()) :: archive_type() | nil
```

Detects the archive type from a path.

# `extract`

```elixir
@spec extract(Path.t(), Path.t()) :: {:ok, Path.t()} | {:error, term()}
```

Extracts an archive to the destination path.

For gzip files, `dest` is the output file path. For other archive types,
`dest` is the destination directory.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
