> ## 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.

# Which function do I call?

> Six functions, three decisions

Every Jetxl function writes a spreadsheet. Which one you want falls out of three independent questions.

## 1. Arrow or dictionaries?

<CardGroup cols={2}>
  <Card title="Arrow — use this" icon="bolt">
    Functions ending in `_arrow`. They read DataFrame memory directly and support every formatting feature. You need Polars, Pandas or PyArrow.
  </Card>

  <Card title="Dictionaries — legacy" icon="box-archive">
    `write_sheet` and `write_sheets`. A plain `dict` of column name to list, with no DataFrame dependency, but slower and charts are the only extra supported.
  </Card>
</CardGroup>

The dictionary functions exist for backward compatibility. Prefer Arrow unless you specifically want no DataFrame dependency.

## 2. One sheet or many?

Singular writes one sheet. Plural takes a list of sheet dictionaries and generates their XML in parallel.

```python theme={null}
# One
jet.write_sheet_arrow(df.to_arrow(), "out.xlsx", styled_headers=True)

# Many — every option becomes a key in the sheet dict
jet.write_sheets_arrow(
    [
        {"data": df_sales.to_arrow(), "name": "Sales", "styled_headers": True},
        {"data": df_costs.to_arrow(), "name": "Costs", "auto_width": True},
    ],
    "out.xlsx",
    num_threads=2,
)
```

<Warning>
  `num_threads` is a required positional argument on `write_sheets_arrow` and `write_sheets`. It has no default, and omitting it raises a `TypeError`. On the bytes variant it defaults to `1`.
</Warning>

## 3. A file or bytes?

<AccordionGroup>
  <Accordion title="A file on disk" icon="file-arrow-down">
    `write_sheet_arrow(data, "report.xlsx", ...)` takes a filename, returns nothing, and leaves the file where you asked for it.
  </Accordion>

  <Accordion title="Bytes in memory" icon="memory">
    `write_sheet_arrow_to_bytes(data, ...)` takes no filename and returns `bytes`. Use it for HTTP responses, cloud functions, and object storage uploads, anywhere a temporary file would be a nuisance. See [In-memory output](/guides/in-memory).
  </Accordion>
</AccordionGroup>

## The full grid

|           | File, one sheet     | File, many           | Bytes, one                   | Bytes, many                   |
| --------- | ------------------- | -------------------- | ---------------------------- | ----------------------------- |
| **Arrow** | `write_sheet_arrow` | `write_sheets_arrow` | `write_sheet_arrow_to_bytes` | `write_sheets_arrow_to_bytes` |
| **Dict**  | `write_sheet`       | `write_sheets`       | —                            | —                             |

<Note>
  The four Arrow functions accept the same formatting arguments. Learn them once on `write_sheet_arrow` and they carry across.
</Note>
