A tool from Excelano

xshape

Reshape for tabular data.

xshape changes the geometry of a table — which axis holds which cells — and never changes, filters, or aggregates a value. Pivot a long table into a matrix, unpivot a wide export back to long so it can be queried, split one column into several, explode a delimited cell into rows, merge columns into one, or transpose a sheet that arrived sideways. Every cell that goes in comes out somewhere else, unchanged.

The data is right, but oriented wrong

Every messy-CSV workflow eventually hits the same wall: the data is correct but pointed the wrong way for the next step. A wide fiscal-year export has to go long before SQL can group it. A long event log has to spread into a matrix before a human can read it. One cell holds three application names glued together by a semicolon, and each one needs its own row. The whole sheet arrived transposed. None of this changes what the data says — it only changes which axis holds what.

That job never quite had a home. So the reach was always for a general-purpose reshaper with a hundred other features bolted on — Miller, tidyr, a throwaway pandas melt or pivot or explode. xshape is that one job, done with a bright boundary. It moves cells between the row and column axes, it makes you state your separator rather than guess one, and it errors rather than aggregate when two cells would collide — because the moment a reshape needs a SUM, it has stopped being a reshape and become a query.

That discipline is the whole point. xshape never coerces, trims, or invents a value; it never drops a row by a predicate or combines two you didn't ask it to. What comes out is exactly what went in, rearranged — which is what makes the result safe to trust and hand to the next tool.

See it in action

A contract-spending export, wide: one column per fiscal year. Before it can be grouped or charted it has to go long — one row per contract-year. That is unpivot, and the reshaped table is the whole preview, straight to stdout.

$ xshape unpivot --cols '[fy2020]:[fy2026]' --into fiscal_year,spend contracts.csv

contract_id,vendor,fiscal_year,spend
0000000000000000000002256,IDEMIA Identity & Security,fy2020,0.00
0000000000000000000002256,IDEMIA Identity & Security,fy2021,0.00
0000000000000000000002256,IDEMIA Identity & Security,fy2022,0.00
…

The twenty-five-digit contract id kept every leading zero — xshape moves cells, it never reinterprets them. Point it the other way and pivot spreads the long table back into a matrix; feed it a semicolon-delimited cell and explode gives you one row per value, the other fields repeated. If a pivot would land two values in one cell, xshape stops and names xql — deduping and totalling are a query's job, not a reshape's.

The reshaping member of the tabular family

xshape is one of a small family of tools for messy tabular data, split by what changes. xray observes — it profiles the file and changes nothing. xled edits cell values in place, sed and awk for tables. xshape changes the shape of the grid and never touches the values. xql queries the row set — filter, aggregate, group, join.

The line that keeps xshape focused: it moves cells between axes, and refuses to aggregate. An aggregating pivot (pivot … SUM) is a query, so it belongs to xql or DuckDB — and xshape's own error will point you there. It shares xled's column-addressing dialect, so pointing at a column in one tool points at it identically in the other; the family reads as one language with different verbs.

Install

xshape is a single binary for Linux and macOS, with nothing to install alongside it. The command, the apt package, the Homebrew formula, and the crate are all xshape — one name everywhere.

On Debian or Ubuntu

Add the Excelano apt repository once, so apt upgrade keeps it current. Both amd64 and arm64 packages ship with every release:

curl -fsSL https://excelano.com/apt/setup.sh | sudo sh
sudo apt install xshape

With Homebrew

On macOS or Linux, so brew upgrade keeps it current:

brew tap excelano/tap
brew trust excelano/tap   # one-time: Homebrew gates third-party taps behind explicit trust
brew install xshape

On Linux or macOS

A one-line installer downloads the right build for your platform, verifies its checksum, and drops the xshape command on your path:

curl --proto '=https' --tlsv1.2 -LsSf https://raw.githubusercontent.com/excelano/xshape/main/install.sh | sh

With cargo

If you have a Rust toolchain, install the published crate from crates.io. This compiles from source rather than fetching a prebuilt binary, so it is slower than the installer above but needs nothing else:

cargo install xshape

Prebuilt binaries

Raw tarballs for every platform are on the GitHub releases page. To build from source you need only a Rust toolchain; the README covers it.

Behind the tool

I built xshape because I kept hitting the same moment mid-session: a table that was correct but oriented wrong, and no focused tool to turn it. Reaching for a whole data-frame library to melt one wide export felt like too much machinery for one small, exact job. So I gave the job its own tool and drew a hard line around it — xshape changes geometry and nothing else. The instant it would need to total or filter, it stops and hands off. A reshape you can't trust to leave your values alone is a reshape you route around.

Turning exports into a shape a client can actually use — portfolio data, inventories, the tables that fall out of Microsoft 365 — is a real part of what I do. If you have a pile of that work and would rather hand it to someone who treats the data with care, that's the kind of thing I'm glad to take on.

Get in touch

For technical users

xshape is open source under the MIT license, written in pure Rust with no C dependencies and no runtime. It parses CSV correctly — quotes, embedded commas and newlines — keeps every value as text so leading zeros and long identifiers survive a reshape, and requires an explicit separator for split, explode, and merge because a guessed delimiter is a silent corruption. The full source and the verb reference live at github.com/excelano/xshape; the security policy is in SECURITY.md.

xshape was built for AI coding agents as much as for people, so the repository ships an official Claude Code skill. With a tidyr/pandas/Miller translation table and the three boundary rules, it teaches an agent to reach for xshape instead of a pandas melt the moment a reshape is needed — and to hand an aggregating pivot to xql instead of forcing it.