> ## Documentation Index
> Fetch the complete documentation index at: https://jetxl.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Bytes functions

> Return a workbook as bytes instead of writing a file

## write\_sheet\_arrow\_to\_bytes

```python theme={null}
jet.write_sheet_arrow_to_bytes(arrow_data, **options) -> bytes
```

Identical to [`write_sheet_arrow`](/reference/write-sheet-arrow) except that it takes no `filename` and returns the workbook.

<ParamField path="arrow_data" type="Any" required>Arrow table or DataFrame conversion.</ParamField>

All formatting options carry over unchanged: `sheet_name`, `styled_headers`, `freeze_rows`, `freeze_cols`, `auto_width`, `auto_filter`, `write_header_row`, `column_widths`, `column_formats`, `merge_cells`, `data_validations`, `hyperlinks`, `row_heights`, `cell_styles`, `formulas`, `conditional_formats`, `tables`, `charts`, `images`, `gridlines_visible`, `zoom_scale`, `tab_color`, `default_row_height`, `hidden_columns`, `hidden_rows`, `right_to_left`, `data_start_row`, and `header_content`.

### Returns

`bytes`, the complete `.xlsx` file.

## write\_sheets\_arrow\_to\_bytes

```python theme={null}
jet.write_sheets_arrow_to_bytes(sheets_data, num_threads=1) -> bytes
```

<ParamField path="sheets_data" type="list[dict]" required>
  The same sheet dictionaries as [`write_sheets_arrow`](/reference/multi-sheet-functions).
</ParamField>

<ParamField path="num_threads" type="int" default="1">
  Defaults to `1` here, unlike the file-writing variant where it's required.
</ParamField>

### Returns

`bytes`.

## Usage

See [In-memory output](/guides/in-memory) for framework examples.

<Warning>
  Jetxl holds the whole workbook in memory before returning it. A million-row sheet approaches a gigabyte during generation, which is acceptable on a server and risky in a constrained function runtime. Write to a file for very large exports.
</Warning>
