# 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")
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.dicas-de-django.com.br/101-35-export-xlsx.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
