> This page is for version 26.07 · v1.3.0.
> For other versions, use one of these documentation indexes:
> - Latest · v1.4.0 (26.09) (default): https://docs.nvidia.com/nemo/curator/latest/llms.txt
> - Main · preview: https://docs.nvidia.com/nemo/curator/main/llms.txt
> - 26.09 · v1.4.0: https://docs.nvidia.com/nemo/curator/v26.09/llms.txt
> - 26.07 · v1.3.0: https://docs.nvidia.com/nemo/curator/v26.07/llms.txt
> - 26.04 · v1.2.0: https://docs.nvidia.com/nemo/curator/v26.04/llms.txt
> - 26.02 · v1.1.0: https://docs.nvidia.com/nemo/curator/v26.02/llms.txt
> - 25.09 · v1.0.0: https://docs.nvidia.com/nemo/curator/v25.09/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nemo/curator/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/nemo/curator/_mcp/server.

# nemo_curator.utils.writer_utils

## Module Contents

### Classes

| Name                                                                      | Description                                                            |
| ------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
| [`JsonEncoderCustom`](#nemo_curator-utils-writer_utils-JsonEncoderCustom) | Custom JSON encoder that handles types that are not JSON serializable. |

### Functions

| Name                                                              | Description                  |
| ----------------------------------------------------------------- | ---------------------------- |
| [`write_bytes`](#nemo_curator-utils-writer_utils-write_bytes)     | Write bytes to local path.   |
| [`write_csv`](#nemo_curator-utils-writer_utils-write_csv)         | Write csv to local path.     |
| [`write_json`](#nemo_curator-utils-writer_utils-write_json)       | Write json to local path.    |
| [`write_parquet`](#nemo_curator-utils-writer_utils-write_parquet) | Write parquet to local path. |

### API

```python
class nemo_curator.utils.writer_utils.JsonEncoderCustom()
```

**Bases:** `JSONEncoder`

Custom JSON encoder that handles types that are not JSON serializable.

Example:

```python
json.dumps(data, cls=JsonEncoderClass)
```

```python
nemo_curator.utils.writer_utils.JsonEncoderCustom.default(
    obj: object
) -> str | object
```

Encode an object for JSON serialization.

**Parameters:**

**`obj`** `object`

Object to encode.

---

**Returns:** `str | object`

Encoded object.

```python
nemo_curator.utils.writer_utils.write_bytes(
    buffer: bytes,
    dest: pathlib.Path,
    desc: str,
    source_video: str,
    verbose: bool,
    backup_and_overwrite: bool = False,
    overwrite: bool = False
) -> None
```

Write bytes to local path.

**Parameters:**

**`buffer`** `bytes`

Bytes to write.

---

**`dest`** `pathlib.Path`

Destination to write.

---

**`desc`** `str`

Description of the write.

---

**`source_video`** `str`

Source video.

---

**`verbose`** `bool`

Verbosity.

---

**`client`**

Storage client.

---

**`backup_and_overwrite`** `bool` — default: False

Backup and overwrite.

---

**`overwrite`** `bool` — default: False

Overwrite.

---

```python
nemo_curator.utils.writer_utils.write_csv(
    dest: pathlib.Path,
    desc: str,
    source_video: str,
    data: list[list[str]],
    verbose: bool,
    backup_and_overwrite: bool = False
) -> None
```

Write csv to local path.

**Parameters:**

**`dest`** `pathlib.Path`

Destination to write.

---

**`desc`** `str`

Description of the write.

---

**`source_video`** `str`

Source video.

---

**`data`** `list[list[str]]`

Data to write.

---

**`verbose`** `bool`

Verbosity.

---

**`client`**

Storage client.

---

**`backup_and_overwrite`** `bool` — default: False

Backup and overwrite.

---

```python
nemo_curator.utils.writer_utils.write_json(
    data: dict[str, typing.Any],
    dest: pathlib.Path,
    desc: str,
    source_video: str,
    verbose: bool,
    backup_and_overwrite: bool = False,
    overwrite: bool = False
) -> None
```

Write json to local path.

**Parameters:**

**`data`** `dict[str, Any]`

Data to write.

---

**`dest`** `pathlib.Path`

Destination to write.

---

**`desc`** `str`

Description of the write.

---

**`source_video`** `str`

Source video.

---

**`verbose`** `bool`

Verbosity.

---

**`client`**

Storage client.

---

**`backup_and_overwrite`** `bool` — default: False

Backup and overwrite.

---

**`overwrite`** `bool` — default: False

Overwrite.

---

```python
nemo_curator.utils.writer_utils.write_parquet(
    data: list[dict[str, str]],
    dest: pathlib.Path,
    desc: str,
    source_video: str,
    verbose: bool,
    backup_and_overwrite: bool = False,
    overwrite: bool = False
) -> None
```

Write parquet to local path.

**Parameters:**

**`data`** `list[dict[str, str]]`

Data to write.

---

**`dest`** `pathlib.Path`

Destination to write.

---

**`desc`** `str`

Description of the write.

---

**`source_video`** `str`

Source video.

---

**`verbose`** `bool`

Verbosity.

---

**`client`**

Storage client.

---

**`backup_and_overwrite`** `bool` — default: False

Whether to backup existing file before overwriting.

---

**`overwrite`** `bool` — default: False

Whether to overwrite existing file.

---