xan

Rust command line tool for processing large CSV files: preview, filter, sort, join, aggregate, and plot, with its own expression language and multithreading.

install

xan is a command line tool for processing CSV files from the shell. It is written in Rust and uses a SIMD CSV parser (simd-csv). Some computations can be parallelized across threads. It started as a fork of BurntSushi's xsv and has since been almost entirely rewritten for the use cases of SciencesPo's médialab.

It provides a large set of composable commands that can be chained in pipelines to preview, filter, slice, aggregate, sort and join tabular data. Examples from the quick tour include xan headers, xan count, xan view (a table preview in the terminal, with a -p pager flag on unix), xan flatten (a row-by-row view of fields) and xan search -s outreach internationale medias.csv | xan view. For tasks the simple commands can't cover, xan has its own minimalistic expression language tailored to CSV data.

Beyond core tabular operations, xan includes utilities for lexicometry, graph theory and scraping. It can also draw terminal visualisations: histograms, scatterplots, time series, small multiples, correlation matrices and heatmaps. It reads CSV-adjacent formats such as web archive .cdx and bioinformatics formats (.vcf, .gtf, .sam, .bed). xan from and xan to convert to and from JSON, NDJSON, Excel and numpy arrays. It can also use parquet files, and it supports compressed files and shell completions for commands and column names (xan completions). It suits data analysts, researchers and developers who work with large CSV files in the terminal.

Installation

# via Homebrew
brew install xan
# via Cargo
cargo install xan --locked
# via Pacman
sudo pacman -S xan

Alternatives & related tools

add a badge to your README

Maintain xan? Show that it's featured on trmn. The badge links back to this page.

Featured on trmn
Markdown
[![Featured on trmn](https://www.trmn.sh/badge/xan.svg)](https://www.trmn.sh/tools/xan?utm_source=badge)
HTML
<a href="https://www.trmn.sh/tools/xan?utm_source=badge"><img src="https://www.trmn.sh/badge/xan.svg" alt="Featured on trmn" height="20"></a>