Repolode
medialab

medialab/xan

A Rust command-line tool for previewing, filtering, aggregating, joining and transforming CSV and TSV files directly in the shell.

Open-source alternative to:Microsoft Excel

Stars
4,540
Forks
94
Open issues
127
Last commit
19 hours ago

What is it?

xan is a command-line tool for processing CSV files from the shell. It provides a large set of composable subcommands for previewing, searching, filtering, slicing, sorting, deduplicating, aggregating and joining tabular data, and these commands can be chained together in pipelines.

It is written in Rust and built around a SIMD CSV parser, with some computations parallelized across threads, so it can handle files from gigabytes to terabytes. It also ships its own expression language tailored to CSV rows, used by commands such as filter, map, transform, agg and groupby, and it can convert to and from formats such as JSON, NDJSON, Excel and Parquet.

The project originated as a fork of xsv and was largely rewritten by SciencesPo's médialab, with features aimed at web data collection and social science analysis, including lexicometry, graph utilities and HTML scraping. It also offers terminal views, histograms, plots and heatmaps for quick exploration.

Key features

  • 01Preview, search, filter, slice, sort and deduplicate CSV files from the shell.
  • 02Aggregate and group data with a custom expression language.
  • 03Join, merge, split and reshape tables with pivot and unpivot.
  • 04Convert between CSV and formats such as JSON, NDJSON, Excel and Parquet.
  • 05Read gzip and zstd compressed files and common bioinformatics formats like VCF, SAM and BED.
  • 06Draw histograms, scatter plots and heatmaps in the terminal.

Use cases

  • Quickly inspecting or filtering a large CSV export without loading it into a spreadsheet.
  • Building repeatable shell pipelines for cleaning and aggregating tabular data.
  • Computing frequency tables and descriptive statistics on survey or web-crawl datasets.
  • Converting data between CSV and JSON or Excel formats in scripts.

Quick start

  1. 1

    Install xan with Cargo

    cargo install xan --locked
  2. 2

    Download the sample corpus

    curl -LO https://github.com/medialab/corpora/raw/master/polarisation/medias.csv
  3. 3

    Preview the file in the terminal

    xan view medias.csv

Topics

FAQ

What is xan?
A Rust command-line tool for previewing, filtering, aggregating, joining and transforming CSV and TSV files directly in the shell. xan is a command-line tool for processing CSV files from the shell. It provides a large set of composable subcommands for previewing, searching, filtering, slicing, sorting, deduplicating, aggregating and joining tabular data, and these commands can be chained together in pipelines.
Is xan free to use? What license does it have?
xan is open source under the Unlicense license. Check the license terms before using it in commercial products.
Is xan still maintained?
Actively maintained. The last commit to xan was on Oct 20, 2026.
What can I use xan for?
Quickly inspecting or filtering a large CSV export without loading it into a spreadsheet. Building repeatable shell pipelines for cleaning and aggregating tabular data. Computing frequency tables and descriptive statistics on survey or web-crawl datasets. Converting data between CSV and JSON or Excel formats in scripts.
How do I install xan?
Install xan with Cargo: cargo install xan --locked Download the sample corpus: curl -LO https://github.com/medialab/corpora/raw/master/polarisation/medias.csv Preview the file in the terminal: xan view medias.csv
Where can I get xan?
The source code and installation instructions are on GitHub: https://github.com/medialab/xan

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects