xlsx
O que ela faz
Ensina seu agente a trabalhar com arquivos do Excel e com tabelas CSV ou TSV. Ela é para quem precisa que planilhas sejam feitas, corrigidas ou analisadas.
Quando usar
- ✓Quando você envia um arquivo Excel ou CSV e quer que os dados sejam analisados ou limpos.
- ✓Quando precisa de uma planilha nova com fórmulas, formatação ou gráficos.
- ✓Quando quer transformar uma tabela bagunçada em uma planilha limpa e utilizável.
Link da skill
https://github.com/HKUDS/DeepTutor/blob/main/deeptutor/skills/builtin/xlsx/SKILL.mdCopie e cole na sua IA (Claude, ChatGPT ou Cursor) pedindo para seguir as instruções.
Como usar
O jeito mais fácil: copie a mensagem e cole na sua IA. Ela lê a skill e segue as instruções.
Mensagem pronta para colar
Para Claude Code, Codex ou Cursor: rode na pasta do projeto e a skill fica instalada.
Baixe o SKILL.md e coloque na pasta de skills do seu agente.
Exemplo do que pedir para a IA
“Pode limpar esta planilha e adicionar uma coluna com o total mensal para mim?”
5 skills novas por semana. 1 minuto de leitura.
Como funciona
O agente usa uma biblioteca Python para escrever dados, fórmulas, estilos e gráficos em uma pasta de trabalho. Depois de salvar, ele reabre o arquivo para conferir.
Conteúdo técnico (SKILL.md original)
Texto original do autor, em inglês, direto do GitHub.
Excel (.xlsx) workbooks
Runtime
Use exec with complete Python source (language: python). Prefer creating,
saving, reopening, and validating the workbook in one call; later calls can
revise the same relative filename. Follow the turn's User workspace
instructions for locating inputs, output boundaries, and presenting the
finished file.
Use openpyxl for cells, formulas, styles, charts, merged cells, multi-sheet workbooks, number formats, and streaming large sheets. It is declared by every supported DeepTutor installation. Do not assume pandas is installed: it exists in the Docker runner but is not a direct dependency of every pip/source install.
THE critical gotcha: openpyxl writes formulas but never computes them
ws["B10"] = "=SUM(B2:B9)" stores the formula string. openpyxl has no formula
engine — the cached value stays empty (or stale, on an edited file). So:
- A workbook you create/edit with openpyxl opens fine in Excel/LibreOffice (they recompute on open), but its cached values are wrong until then.
- Anything reading cached values first —
data_only=True, another pandas/openpyxl pass, or a downstream tool — sees blanks/stale data.
Pick by what the deliverable needs:
- Static numbers (most common). If the user just needs correct values and
the sheet need not stay live, compute in Python and write the number, not
a formula string:
ws["B10"] = sum(c.value for c in ws["B2:B9"][0]). Correct immediately, no recalc needed. - Live model (formulas that recompute on the user's later edits). Write real
formulas, and reference cells not literals (
=B5*(1+$B$6), not=B5*1.05). openpyxl can't set the cached value too. Ifshutil.which("soffice")succeeds, recalculate throughexecusingsubprocess.runand a relative_recalc/directory, replaceout.xlsxwith the recalculated copy, then remove_recalc/. Never use/tmpor search for a desktop installation. A later exec call can see the same bare filename. If LibreOffice is absent, warn that formulas populate when the user opens the file in Excel.
Reading
from openpyxl import load_workbook
wb = load_workbook("in.xlsx", read_only=True, data_only=False)
for sheet_name in wb.sheetnames:
ws = wb[sheet_name]
for row in ws.iter_rows(values_only=True):
print(row)
To read computed results of formulas (not the formula text), use openpyxl
with data_only=True — returns the value Excel last cached:
from openpyxl import load_workbook
wb = load_workbook("in.xlsx", data_only=True)
val = wb["Sheet1"]["B10"].value # None if Excel never opened/saved the file
Gotcha: never save() a workbook loaded with data_only=True — that discards
every formula permanently (verified: the cell becomes None). Load twice if you
need both formulas and values.
Large file: load_workbook(path, read_only=True) streams rows cheaply.
Creating
from openpyxl import Workbook, load_workbook
from openpyxl.styles import Font, PatternFill, Alignment
wb = Workbook()
ws = wb.active
ws.title = "Summary"
ws.append(["Region", "Sales"]) # header row
for r in [("West", 120), ("East", 95)]:
ws.append(r)
ws["B4"] = "=SUM(B2:B3)" # see formula gotcha above
ws["A1"].font = Font(bold=True)
ws["A1"].fill = PatternFill("solid", fgColor="DDDDDD")
ws["A1"].alignment = Alignment(horizontal="center")
ws["B2"].number_format = "#,##0" # thousands separator
ws.column_dimensions["A"].width = 18
ws.freeze_panes = "A2" # freeze header
wb.create_sheet("Detail") # second sheet
wb.save("out.xlsx")
# Validate immediately; later exec calls can also reopen this relative path.
check = load_workbook("out.xlsx", data_only=False)
assert check.sheetnames, "generated workbook has no worksheets"
import zipfile
with zipfile.ZipFile("out.xlsx") as package:
assert package.testzip() is None, "generated XLSX has a corrupt ZIP member"
For large exports, use openpyxl's write-only mode and append rows without holding every cell object in memory:
from openpyxl import Workbook
wb = Workbook(write_only=True)
ws = wb.create_sheet("Data")
ws.append(["id", "value"])
for row in rows:
ws.append(row)
wb.save("out.xlsx")
Editing (preserve existing formatting)
load_workbook keeps styles, formulas, merged cells, charts intact — edit only
what you touch. Do NOT round-trip through pandas to preserve formatting (pandas
rewrites the whole sheet, losing styles).
``
Perguntas frequentes
Ele consegue trabalhar com fórmulas?
Sim. Ele pode escrever fórmulas, embora alguns valores só sejam atualizados quando o arquivo é aberto no Excel ou em outro aplicativo de planilhas.
Ele consegue fazer gráficos?
Sim. A skill também cobre células mescladas, formatos de número e pastas de trabalho com várias abas.
Ele trabalha com arquivos CSV?
Sim. A skill cobre tabelas CSV e TSV em lote, além de arquivos Excel.
Detalhes
Descrição original do autor
Read, create, or edit Excel spreadsheets (.xlsx/.xlsm) — sheet data, formulas, styles, charts, multi-sheet workbooks — and bulk .csv/.tsv tables; use whenever a spreadsheet is the input or the deliverable (extract/analyze data, add columns/formulas/formatting/charts, clean messy tables, build from scratch), but not for Google Sheets API or Word/PDF/script outputs.
repo: HKUDS/DeepTutor
Popularidade
- Estrelas no GitHub
- 54 mil
- Posição no ranking
- #3372
- Licença
- Apache-2.0
- Atualizada em
- 31/10/2026
Comentários
- …
Mais skills deste repositório
deeptutor-cli
54 milAjuda seu agente a configurar e executar o DeepTutor, uma plataforma de aprendizado, pela linha de comando, incluindo bases de conhecimento, cadernos e o aplicativo web.
docx
54 milAjuda seu agente a ler, criar e editar arquivos Word .docx, incluindo relatórios, tabelas, localizar e substituir, e controle de alterações com comentários.
Ajuda seu agente a ler, unir, dividir, preencher e criar arquivos PDF, incluindo extrair texto e tabelas deles.
pptx
54 milPermite que seu agente crie, leia e edite apresentações do PowerPoint, incluindo texto de slides, anotações do orador, gráficos e imagens.
Skills parecidas
feishu-doc
394 milAjuda seu agente a ler, criar e editar documentos na nuvem do Feishu, incluindo textos, imagens e tabelas, usando a ferramenta de documentos.
feishu-drive
394 milPermite que seu agente navegue, organize e comente arquivos de uma pasta na nuvem do Feishu que foi compartilhada com o bot.
feishu-perm
394 milAjuda seu agente a verificar e alterar quem pode acessar um arquivo do Feishu, escolhendo a menor permissão que atende ao seu pedido.