# flytekit.tools.ignore

## Directory

### Classes

| Class | Description |
|-|-|
| [`DockerIgnore`](https://www.union.ai/docs/v1/selfmanaged/api-reference/flytekit-sdk/packages/flytekit.tools.ignore/page.md#flytekittoolsignoredockerignore) | Uses docker-py's PatternMatcher to check whether a path is ignored. |
| [`FlyteIgnore`](https://www.union.ai/docs/v1/selfmanaged/api-reference/flytekit-sdk/packages/flytekit.tools.ignore/page.md#flytekittoolsignoreflyteignore) | Uses a. |
| [`GitIgnore`](https://www.union.ai/docs/v1/selfmanaged/api-reference/flytekit-sdk/packages/flytekit.tools.ignore/page.md#flytekittoolsignoregitignore) | Uses git cli (if available) to list all ignored files and compare with those. |
| [`Ignore`](https://www.union.ai/docs/v1/selfmanaged/api-reference/flytekit-sdk/packages/flytekit.tools.ignore/page.md#flytekittoolsignoreignore) | Base for Ignores, implements core logic. |
| [`IgnoreGroup`](https://www.union.ai/docs/v1/selfmanaged/api-reference/flytekit-sdk/packages/flytekit.tools.ignore/page.md#flytekittoolsignoreignoregroup) | Groups multiple Ignores and checks a path against them. |
| [`StandardIgnore`](https://www.union.ai/docs/v1/selfmanaged/api-reference/flytekit-sdk/packages/flytekit.tools.ignore/page.md#flytekittoolsignorestandardignore) | Retains the standard ignore functionality that previously existed. |

### Variables

| Property | Type | Description |
|-|-|-|
| `STANDARD_IGNORE_PATTERNS` | `list` |  |

## flytekit.tools.ignore.DockerIgnore

Uses docker-py's PatternMatcher to check whether a path is ignored.

```python
class DockerIgnore(
    root: pathlib._local.Path,
)
```
| Parameter | Type | Description |
|-|-|-|
| `root` | `pathlib._local.Path` | |

### Methods

| Method | Description |
|-|-|
| [`is_ignored()`](#is_ignored) |  |
| [`tar_filter()`](#tar_filter) |  |

#### is_ignored()

```python
def is_ignored(
    path: str,
) -> bool
```
| Parameter | Type | Description |
|-|-|-|
| `path` | `str` | |

#### tar_filter()

```python
def tar_filter(
    tarinfo: tarfile.TarInfo,
) -> typing.Optional[tarfile.TarInfo]
```
| Parameter | Type | Description |
|-|-|-|
| `tarinfo` | `tarfile.TarInfo` | |

## flytekit.tools.ignore.FlyteIgnore

Uses a .flyteignore file to determine ignored files.

```python
class FlyteIgnore(
    root: pathlib._local.Path,
)
```
| Parameter | Type | Description |
|-|-|-|
| `root` | `pathlib._local.Path` | |

### Methods

| Method | Description |
|-|-|
| [`is_ignored()`](#is_ignored) |  |
| [`tar_filter()`](#tar_filter) |  |

#### is_ignored()

```python
def is_ignored(
    path: str,
) -> bool
```
| Parameter | Type | Description |
|-|-|-|
| `path` | `str` | |

#### tar_filter()

```python
def tar_filter(
    tarinfo: tarfile.TarInfo,
) -> typing.Optional[tarfile.TarInfo]
```
| Parameter | Type | Description |
|-|-|-|
| `tarinfo` | `tarfile.TarInfo` | |

## flytekit.tools.ignore.GitIgnore

Uses git cli (if available) to list all ignored files and compare with those.

```python
class GitIgnore(
    root: pathlib._local.Path,
)
```
| Parameter | Type | Description |
|-|-|-|
| `root` | `pathlib._local.Path` | |

### Methods

| Method | Description |
|-|-|
| [`is_ignored()`](#is_ignored) |  |
| [`tar_filter()`](#tar_filter) |  |

#### is_ignored()

```python
def is_ignored(
    path: str,
) -> bool
```
| Parameter | Type | Description |
|-|-|-|
| `path` | `str` | |

#### tar_filter()

```python
def tar_filter(
    tarinfo: tarfile.TarInfo,
) -> typing.Optional[tarfile.TarInfo]
```
| Parameter | Type | Description |
|-|-|-|
| `tarinfo` | `tarfile.TarInfo` | |

## flytekit.tools.ignore.Ignore

Base for Ignores, implements core logic. Children have to implement _is_ignored

```python
class Ignore(
    root: str,
)
```
| Parameter | Type | Description |
|-|-|-|
| `root` | `str` | |

### Methods

| Method | Description |
|-|-|
| [`is_ignored()`](#is_ignored) |  |
| [`tar_filter()`](#tar_filter) |  |

#### is_ignored()

```python
def is_ignored(
    path: str,
) -> bool
```
| Parameter | Type | Description |
|-|-|-|
| `path` | `str` | |

#### tar_filter()

```python
def tar_filter(
    tarinfo: tarfile.TarInfo,
) -> typing.Optional[tarfile.TarInfo]
```
| Parameter | Type | Description |
|-|-|-|
| `tarinfo` | `tarfile.TarInfo` | |

## flytekit.tools.ignore.IgnoreGroup

Groups multiple Ignores and checks a path against them. A file is ignored if any
Ignore considers it ignored.

```python
class IgnoreGroup(
    root: str,
    ignores: typing.List[typing.Type[flytekit.tools.ignore.Ignore]],
)
```
| Parameter | Type | Description |
|-|-|-|
| `root` | `str` | |
| `ignores` | `typing.List[typing.Type[flytekit.tools.ignore.Ignore]]` | |

### Methods

| Method | Description |
|-|-|
| [`is_ignored()`](#is_ignored) |  |
| [`list_ignored()`](#list_ignored) |  |
| [`tar_filter()`](#tar_filter) |  |

#### is_ignored()

```python
def is_ignored(
    path: str,
) -> bool
```
| Parameter | Type | Description |
|-|-|-|
| `path` | `str` | |

#### list_ignored()

```python
def list_ignored()
```
#### tar_filter()

```python
def tar_filter(
    tarinfo: tarfile.TarInfo,
) -> typing.Optional[tarfile.TarInfo]
```
| Parameter | Type | Description |
|-|-|-|
| `tarinfo` | `tarfile.TarInfo` | |

## flytekit.tools.ignore.StandardIgnore

Retains the standard ignore functionality that previously existed. Could in theory
by fed with custom ignore patterns from cli.

```python
class StandardIgnore(
    root: pathlib._local.Path,
    patterns: typing.Optional[typing.List[str]],
)
```
| Parameter | Type | Description |
|-|-|-|
| `root` | `pathlib._local.Path` | |
| `patterns` | `typing.Optional[typing.List[str]]` | |

### Methods

| Method | Description |
|-|-|
| [`is_ignored()`](#is_ignored) |  |
| [`tar_filter()`](#tar_filter) |  |

#### is_ignored()

```python
def is_ignored(
    path: str,
) -> bool
```
| Parameter | Type | Description |
|-|-|-|
| `path` | `str` | |

#### tar_filter()

```python
def tar_filter(
    tarinfo: tarfile.TarInfo,
) -> typing.Optional[tarfile.TarInfo]
```
| Parameter | Type | Description |
|-|-|-|
| `tarinfo` | `tarfile.TarInfo` | |

---
**Source**: https://github.com/unionai/unionai-docs/blob/main/content/api-reference/flytekit-sdk/packages/flytekit.tools.ignore.md
**HTML**: https://www.union.ai/docs/v1/selfmanaged/api-reference/flytekit-sdk/packages/flytekit.tools.ignore/
