# Manifest

## timenet.manifest

The dataset manifest: a frozen :class:`Manifest` and its JSON codec.

### Manifest `dataclass`

The single source of truth a consumer reads to interpret a dataset version.

Raises:

| Type | Description |
| --- | --- |
| `InvalidManifestError` | If `timef_format_version` is not a supported version. |

#### SUPPORTED\_FORMAT\_VERSIONS `class-attribute`

```
SUPPORTED_FORMAT_VERSIONS: frozenset[int] = frozenset({1})
```

#### checksums `class-attribute` `instance-attribute`

```
checksums: dict[str, str] = field(default_factory=dict)
```

Per-file checksums keyed by relative path, each `sha256:` prefixed.

#### counts `class-attribute` `instance-attribute`

```
counts: ManifestCounts = field(
    default_factory=ManifestCounts
)
```

Row and entity counts recorded for quick inspection.

#### dataset\_id `instance-attribute`

```
dataset_id: str
```

Denormalized copy of `metadata.dataset_id`, readable without parsing metadata.

#### derived\_from `class-attribute` `instance-attribute`

```
derived_from: dict[str, str] | None = None
```

Copy-on-write lineage (base version + operation), or `None` for a freshly built version.

#### files `instance-attribute`

```
files: ManifestFiles
```

Relative paths to every data artifact, grouped by kind.

#### id\_encoding `class-attribute` `instance-attribute`

```
id_encoding: dict[str, str] = field(default_factory=dict)
```

Logical id -> `"uuid16"` for ids stored as `binary(16)`; absent entries are strings.

#### metadata `instance-attribute`

```
metadata: DatasetMetadata
```

Descriptive identity of the dataset (name, version, license, domains, tags).

#### schema `class-attribute` `instance-attribute`

```
schema: DatasetSchema = field(default_factory=DatasetSchema)
```

Structural schema: time-series specs, data sources, annotations, and tasks.

#### timef\_format\_version `class-attribute` `instance-attribute`

```
timef_format_version: int = 1
```

TimeF manifest format version; must be in `SUPPORTED_FORMAT_VERSIONS`.

#### from\_dict `classmethod`

```
from_dict(data: dict[str, Any]) -> Manifest
```

Parse a manifest dict, tolerating missing optional blocks.

Parameters:

| Name | Type | Description | Default |
| --- | --- | --- | --- |
| `data` | `dict[str, Any]` | The manifest dict (e.g. from `json.loads`). | *required* |

Returns:

| Type | Description |
| --- | --- |
| `Manifest` | The parsed :class:`Manifest`. |

Raises:

| Type | Description |
| --- | --- |
| `InvalidManifestError` | If a required key is missing or a block is malformed. |

#### from\_json `classmethod`

```
from_json(text: str) -> Manifest
```

Parse a manifest from a JSON string.

Parameters:

| Name | Type | Description | Default |
| --- | --- | --- | --- |
| `text` | `str` | The JSON text. | *required* |

Returns:

| Type | Description |
| --- | --- |
| `Manifest` | The parsed :class:`Manifest`. |

Raises:

| Type | Description |
| --- | --- |
| `InvalidManifestError` | If the text is not valid JSON or a block is malformed. |

#### to\_dict

```
to_dict() -> dict[str, Any]
```

Serialize the manifest to a JSON-compatible dict with all keys present.

Returns:

| Type | Description |
| --- | --- |
| `dict[str, Any]` | The canonical dict form. |

#### to\_json

```
to_json() -> str
```

Serialize the manifest to a pretty JSON string.

Returns:

| Type | Description |
| --- | --- |
| `str` | The JSON text. |

### ManifestCounts `dataclass`

Row/entity counts recorded in the manifest for quick inspection without opening the parquet.

#### annotations `class-attribute` `instance-attribute`

```
annotations: int = 0
```

Number of unique annotation ids across all samples.

#### samples `class-attribute` `instance-attribute`

```
samples: int = 0
```

Total number of samples in the dataset.

#### tasks `class-attribute` `instance-attribute`

```
tasks: dict[str, int] = field(default_factory=dict)
```

Count of tasks keyed by task type.

#### time\_series\_chunks `class-attribute` `instance-attribute`

```
time_series_chunks: int = 0
```

Number of time series chunk placements written to parquet.

#### time\_series\_index\_rows `class-attribute` `instance-attribute`

```
time_series_index_rows: int = 0
```

Number of rows in the time series index.

#### time\_series\_specs `class-attribute` `instance-attribute`

```
time_series_specs: dict[str, int] = field(
    default_factory=dict
)
```

Count of unique time series keyed by spec type.

### ManifestFiles `dataclass`

Relative paths to every artifact of a dataset version. Readers use this list, not a glob.

Every artifact is a list of parts, so any of them can shard later without a manifest-format change.
Today the writer emits a single part for `samples` / `annotations` / `time_series_index`;
`tasks` and `time_series` already carry several.

#### annotations `instance-attribute`

```
annotations: tuple[str, ...]
```

Relative path parts of the annotations table.

#### samples `instance-attribute`

```
samples: tuple[str, ...]
```

Relative path parts of the samples table.

#### tasks `class-attribute` `instance-attribute`

```
tasks: tuple[str, ...] = ()
```

Relative path parts of the task tables, one per task type.

#### time\_series `class-attribute` `instance-attribute`

```
time_series: tuple[str, ...] = ()
```

Relative path parts (shards) of the time series data.

#### time\_series\_index `instance-attribute`

```
time_series_index: tuple[str, ...]
```

Relative path parts of the time series index table.

#### all\_parts

```
all_parts() -> tuple[str, ...]
```

Return every file part across all artifacts, in a stable order.

Returns:

| Type | Description |
| --- | --- |
| `str` | The concatenation of the `samples`, `annotations`, `time_series_index`, `tasks`, |
| `...` | and `time_series` parts. |
