← Back to Skills Marketplace
mohamed-hammane

Excel Export

by Umbra · GitHub ↗ · v1.1.0 · MIT-0
cross-platform ✓ Security Clean
131
Downloads
0
Stars
0
Active Installs
3
Versions
Install in OpenClaw
/install excel-export
Description
Generate polished .xlsx workbooks from structured JSON — multiple sheets, frozen headers, filters, typed columns, formulas, totals, and French/Morocco format...
README (SKILL.md)

When to Use

Use when the agent must deliver a .xlsx Excel file — sales reports, query results, multi-sheet data exports, financial summaries, or any structured data that needs polished spreadsheet formatting. This skill handles workbook creation only. Do not use it to read, edit, or preserve existing Excel files.

Setup

python3 -m venv ~/.openclaw/workspace/.venv_excel
~/.openclaw/workspace/.venv_excel/bin/pip install xlsxwriter

No credentials required.

How to Run

~/.openclaw/workspace/.venv_excel/bin/python skills/excel-export/scripts/build_xlsx.py \
  --input  \x3Cpath/to/workbook.json> \
  --output \x3Cpath/to/report.xlsx>

Default export directory: ~/.openclaw/workspace/exports/excel/.

The script prints a JSON summary to stdout on success:

{
  "success": true,
  "output": "/absolute/path/to/report.xlsx",
  "sheets": [
    { "sheet": "Ventes", "rows": 42 },
    { "sheet": "Charges", "rows": 18 }
  ]
}

Input Format

The input is a single JSON file. Top-level shape:

{
  "sheets": [ ... ]
}

Each sheet object:

Field Required Description
name yes Sheet tab name (max 31 chars)
title no Bold title row above the table
subtitle no Muted subtitle row below the title
columns yes Array of column definitions
rows no Array of data objects (keyed by key)

Each column object:

Field Required Description
key yes Row-object key for this column's values
header yes Display header in the table
type no Data type (default text) — see table below
width no Explicit column width (overrides auto-estimate)
numfmt no Custom Excel number format (overrides type default)
formula no Excel table structured-reference formula
total no Totals-row function: sum, average, or count

Rows are objects keyed by column key, not positional arrays. Missing keys produce blank cells. Unknown keys cause a validation error.

Column Types

Type Default format Notes
text Always stored as text
integer #,##0 Rounded to whole number
number #,##0.00 Two decimal places
percent 0.0% Pass 0.15 for 15 %
currency #,##0.00 "MAD" Moroccan dirham by default
date dd/mm/yyyy Accepts YYYY-MM-DD strings
datetime dd/mm/yyyy hh:mm Accepts ISO 8601 strings
boolean Rendered as Oui / Non

Use numfmt on any column to override its type's default format.

Rendering Rules

Layout — fixed, deterministic, never configured per-sheet:

  • No title/subtitle → table header on row 1.
  • Title only → title row 1, blank row 2, table header row 3.
  • Title + subtitle → title row 1, subtitle row 2, blank row 3, table header row 4.

Freeze pane — always at the first data row (A2, A4, or A5 depending on title presence).

Table style — each sheet is one rectangular Excel table with filters, banded rows, and Table Style Medium 9.

Column widths — auto-estimated from headers and sampled values, capped at 50 characters. Explicit width in the column definition overrides the estimate.

Formulas — use Excel structured references (e.g. =[@Revenue]/SUM([Revenue])). Formula columns are injected through the table definition, not written cell-by-cell, so they apply to every data row automatically.

Totals row — if any column has total, the table includes a totals row. The first column displays "Total" as a label unless it has its own total function.

Empty datasets — produce a valid workbook with headers, filters, styling, and zero data rows.

Data-Integrity Doctrine

These rules are always enforced — they are not optional:

  1. Preserve data types. Leading-zero strings, phone numbers (+212…), and numeric strings longer than 15 digits are always stored as text. Excel silently corrupts these if written as numbers.

  2. Keep calculations in Excel. When the workbook should stay live, write formulas — not hardcoded derived values from Python. Use structured references so formulas survive row insertions and deletions.

  3. Treat dates explicitly. Dates are serial numbers with legacy quirks. The script writes real date objects with explicit dd/mm/yyyy formatting — never raw serial numbers or ambiguous strings.

  4. Validate before delivery. The script validates every input field, rejects unknown keys, and fails fast with clear error messages. A workbook should never ship with silent data loss.

  5. Regional defaults are French / Morocco. Date format dd/mm/yyyy, currency MAD, booleans Oui / Non. Note: final display still depends partly on the viewer's local Excel regional settings.

Full Example

{
  "sheets": [
    {
      "name": "Ventes Q1",
      "title": "Rapport des Ventes — Q1 2026",
      "subtitle": "Direction Commerciale",
      "columns": [
        { "key": "region",  "header": "Région",     "type": "text" },
        { "key": "ca",      "header": "CA (MAD)",   "type": "currency", "total": "sum" },
        { "key": "volume",  "header": "Volume",     "type": "integer",  "total": "sum" },
        { "key": "growth",  "header": "Croissance", "type": "percent" },
        { "key": "date",    "header": "Date",       "type": "date" },
        { "key": "active",  "header": "Actif",      "type": "boolean" }
      ],
      "rows": [
        { "region": "Casablanca", "ca": 1250000, "volume": 340, "growth": 0.15, "date": "2026-03-31", "active": true },
        { "region": "Rabat",      "ca": 980000,  "volume": 210, "growth": -0.03, "date": "2026-03-31", "active": true },
        { "region": "Tanger",     "ca": 670000,  "volume": 155, "growth": 0.08,  "date": "2026-03-31", "active": false }
      ]
    }
  ]
}
~/.openclaw/workspace/.venv_excel/bin/python skills/excel-export/scripts/build_xlsx.py \
  --input  ~/.openclaw/workspace/exports/ventes_q1.json \
  --output ~/.openclaw/workspace/exports/excel/ventes_q1.xlsx

Validation Rules

The script fails fast with a clear error on:

  • Invalid or missing JSON
  • Duplicate sheet names
  • Sheet names exceeding 31 characters, containing [ ] : * ? / \, or starting/ending with apostrophes
  • subtitle without title
  • Row count above 1,048,576 or column count above 16,384
  • Unknown keys in row objects
  • Invalid type or total values
  • Non-string formula definitions
  • Unrecognized boolean values (only true/false, 1/0, yes/no, oui/non accepted)
  • Non-integer values in integer columns (e.g. 12.9 is rejected, not truncated)
  • Unparseable dates, datetimes, or numeric strings in typed columns

SQL-Driven Exports

When generating Excel files from SQL query results, read references/SQL_TO_EXCEL_RECIPE.md for the standard pipeline: query with mssql, normalize values, build the JSON spec, then render. The recipe includes SQL-to-JSON type mappings, normalization rules, ready-made templates, and common mistakes.

Limitations (v1)

  • Creation only — does not read or edit existing workbooks.
  • No template preservation, merged cells, or conditional formatting.
  • One fixed visual theme — no configurable colour system.
  • No CSV input — upstream steps must produce JSON.
  • xlsxwriter does not calculate formulas; the recipient's Excel client recalculates on open.
Usage Guidance
This skill appears coherent and limited to creating Excel workbooks from JSON. Before installing: (1) be comfortable running a local Python venv and installing xlsxwriter; (2) inspect scripts/build_xlsx.py (provided) yourself if you require extra assurance — the source is included; (3) note the venv and output paths (under ~/.openclaw/workspace) so you can control where files land; and (4) because the skill has no homepage and an unknown publisher, consider running it in an isolated environment (or review the code) if you need to be extra cautious.
Capability Analysis
Type: OpenClaw Skill Name: excel-export Version: 1.1.0 The excel-export skill is a well-documented and robust tool for generating formatted Excel workbooks from JSON data. The core script, scripts/build_xlsx.py, implements extensive validation for Excel constraints and data types, including specific logic to prevent data loss for long numeric strings and leading zeros. The skill lacks any indicators of malicious intent, such as unauthorized network access, data exfiltration, or suspicious execution patterns, and focuses entirely on its stated purpose of spreadsheet generation with regional defaults for Morocco.
Capability Assessment
Purpose & Capability
Name/description promise (render polished Excel files from JSON) matches the included Python script and SKILL.md. The only required binary is python3 and the SKILL.md asks to install the xlsxwriter Python package — both are directly relevant.
Instruction Scope
SKILL.md contains focused runtime instructions: create a venv, pip install xlsxwriter, and run scripts/build_xlsx.py with --input/--output. The instructions do not request reading unrelated system files, credentials, or sending data to external endpoints. The recipe document references an optional SQL → JSON pipeline, which is guidance not a hidden dependency.
Install Mechanism
There is no registry install spec; SKILL.md recommends creating a local venv and pip installing xlsxwriter from PyPI. This is a standard, low-risk approach (no arbitrary URL downloads or archive extraction).
Credentials
The skill declares no environment variables, credentials, or config path requirements. Nothing in the code or docs asks for unrelated secrets or external tokens.
Persistence & Privilege
The skill is not always-enabled and does not request elevated platform privileges. It creates a local venv under ~/.openclaw/workspace which is reasonable for a Python-based tool and does not modify other skills or system-wide settings.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install excel-export
  3. After installation, invoke the skill by name or use /excel-export
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.1.0
Strict validation: sheet names fail fast (no silent correction, case-insensitive duplicate check), boolean parsing accepts only true/false/1/0/yes/no/oui/non, integer columns reject non-whole values like 12.9, subtitle requires title. Added SQL-to-Excel recipe in references/.
v1.0.1
Added SQL-to-Excel recipe in references/, tightened type validation (fail-fast on invalid typed values, reject booleans in numeric columns, reject subtitle without title), guard 16+ digit numeric IDs from precision loss.
v1.0.0
Initial release — write-only .xlsx generation from JSON with French defaults, typed columns, formulas, totals, and data-integrity guards.
Metadata
Slug excel-export
Version 1.1.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 3
Frequently Asked Questions

What is Excel Export?

Generate polished .xlsx workbooks from structured JSON — multiple sheets, frozen headers, filters, typed columns, formulas, totals, and French/Morocco format... It is an AI Agent Skill for Claude Code / OpenClaw, with 131 downloads so far.

How do I install Excel Export?

Run "/install excel-export" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Excel Export free?

Yes, Excel Export is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Excel Export support?

Excel Export is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Excel Export?

It is built and maintained by Umbra (@mohamed-hammane); the current version is v1.1.0.

💬 Comments