> For the complete documentation index, see [llms.txt](https://www.dicas-de-django.com.br/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.dicas-de-django.com.br/101-35-export-xlsx.md).

# Dica 35 - Exportando XLSX mais rápido com pyexcelerate

[![](/files/-MfuAP1e7W4erW9hf6Ic)](https://youtu.be/0DuLOvnJTMw)

<https://pypi.org/project/PyExcelerate/>

```
pip install pyexcelerate
pip freeze | grep pyexcelerate >> requirements.txt
```

```python
from pyexcelerate import Workbook

data = [(product.title, product.price) for product in Product.objects.all()]
data.insert(0, ('title', 'price'))  # Insere uma tupla no começo da lista.

data

wb = Workbook()
wb.new_sheet("sheet name", data=data)
wb.save("/tmp/products_out.xlsx")
```
