# Timenet.progress

## timenet.progress

Progress events for copying and building releases.

Each release starts with a :class:`StepStarted` event.
A :class:`StepFinished` event follows only if the copy or build succeeds.

### ProgressCallback `module-attribute`

```
ProgressCallback = Callable[[ProgressEvent], None]
```

A callback that receives a progress event and returns nothing.

### ProgressEvent `module-attribute`

```
ProgressEvent = (
    StepStarted | StepFinished | BytesMoved | ShardWritten
)
```

A step, transfer, or shard progress event.

### BytesMoved `dataclass`

The byte count for a transfer in progress.

Attributes:

| Name | Type | Description |
| --- | --- | --- |
| `subject` | `str` | What moves: a source or target URL, or a copied release ID such as `"org/name@1.0.0"`. |
| `done` | `int` | The bytes moved so far. |
| `total` | `int | None` | The total byte count, or `None` if unknown. |

#### done `instance-attribute`

```
done: int
```

#### subject `instance-attribute`

```
subject: str
```

#### total `instance-attribute`

```
total: int | None
```

### ShardWritten `dataclass`

The number of completed shards in a release build.

Attributes:

| Name | Type | Description |
| --- | --- | --- |
| `release` | `DatasetRef` | The release being built. |
| `count` | `int` | The number of shards written so far. |

#### count `instance-attribute`

```
count: int
```

#### release `instance-attribute`

```
release: DatasetRef
```

### StepFinished `dataclass`

The successful completion of a copy or build for one release.

Attributes:

| Name | Type | Description |
| --- | --- | --- |
| `release` | `DatasetRef` | The copied or built release. |
| `action` | `Literal['copy', 'build']` | The completed operation, either `"copy"` or `"build"`. |

#### action `instance-attribute`

```
action: Literal['copy', 'build']
```

#### release `instance-attribute`

```
release: DatasetRef
```

### StepStarted `dataclass`

The start of a copy or build for one release.

Attributes:

| Name | Type | Description |
| --- | --- | --- |
| `release` | `DatasetRef` | The release to copy or build. |
| `action` | `Literal['copy', 'build']` | The operation, either `"copy"` or `"build"`. |

#### action `instance-attribute`

```
action: Literal['copy', 'build']
```

#### release `instance-attribute`

```
release: DatasetRef
```
