xan

médialab Sciences Po·medialab.xan

The CSV magician

xan is a command line tool that can be used to process CSV files directly from the shell. It has been written in Rust to be as fast as possible, use as little memory as possible, and can very easily handle large CSV files (Gigabytes). It leverages a novel SIMD CSV parser and is also able to parallelize some computations (through multithreading) to make some tasks complete as fast as your computer can allow. It can easily preview, filter, slice, aggregate, sort, join CSV files, and exposes a large collection of composable commands that can be chained together to perform a wide variety of typical tasks. xan also offers its own expression language so you can perform complex tasks that cannot be done by relying on the simplest commands. This minimalistic language has been tailored for CSV data and is way faster than evaluating typical dynamically-typed languages such as Python, Lua, JavaScript etc. Note that this tool is originally a fork of BurntSushi's xsv, but has been nearly entirely rewritten at that point, to fit SciencesPo's médialab use-cases, rooted in web data collection and analysis geared towards social sciences (you might think CSV is outdated by now, but read our love letter to the format before judging too quickly). xan therefore goes beyond typical data manipulation and expose utilities related to lexicometry, graph theory and even scraping. Beyond CSV data, xan is able to process a large variety of CSV-adjacent data formats from many different disciplines such as web archival (.cdx) or bioinformatics (.vcf, .gtf, .sam, .bed etc.). xan is also able to convert to & from many data formats such as json, excel files, numpy arrays etc. using xan to and xan from. See this section for more detail. Finally, xan can be used to display CSV files in the terminal, for easy exploration, and can even be used to draw basic data visualisations.

winget install --id medialab.xan --exact --source winget

Latest 0.60.0·July 10, 2026

Release Notes

Breaking

  • Renaming xan from --path to --root.
  • Renaming xan separate -T/--txt to -L/--lines. Features
  • Adding xan count -c/--check-alignment & -H/--human-readable.
  • Adding xan sort -e -z/--compress.
  • Adding xan sample -g -S/--sorted.
  • Adding xan from -f=(json|ndjson) --model.
  • Adding xan cat rows -I/--intersection & -U/--union.
  • Adding xan top -g -S/--sorted.
  • Adding the sort, dedup, flatten & flat_map moonblade function.
  • Adding support for list & map columns when using xan from -f=parquet. Fixes
  • Fixing text wrapping across tool, especially xan flatten -w & xan flatten -F.
  • Fixing xan select -e & xan map plural clause flattening given list.
  • Fixing xan from -f=parquet not emitting correct column names for list & map columns. Performance
  • Introducing a fast path for xan sort -e when input fits in a single chunk.
  • Faster xan from -f=ndjson & -f=parquet.
  • Amortizing xan sample allocations.
  • Improving performance of xan freq & xan p freq. Quality of Life
  • Better record size estimation for xan sort -e.
  • Better xan flatten -c when string width cannot be computed correctly (because of emojis typically).

Installer type: zip

x64E7AD980FB033381F0AE8445330328E086F92443828F89B3E5A6777409B2EC3BD

Details

Homepage
https://github.com/medialab/xan
License
Unlicense, MIT
Publisher
médialab Sciences Po
Support
https://github.com/medialab/xan/issues
Copyright
Copyright (c) 2015-2026 Andrew Gallant, Guillaume Plique

Tags

csvdatadatasciencediagramgraphgraphicsplotstatisticsstats

Older versions (9)

0.59.0
x64A23E45744DC804745318C927BE1E3C657C2592BE3622073A59A481AA5E9B8423
0.58.0
x641390BD9202799FD7469BB9163039998AD7F96BC4ED3CE2BF2BB8550EC3FC167F
0.57.1
x64D2539B421CEA8CAB24BAF5B70CAD3CB299B4997EC38384336C0779CD0A4E7CAC
0.57.0
x64DC07694298DEA6A777A3C70AED06818FBDD036D5A0FBD38C37027149EFE0A5B6
0.56.0
x6430447BB352627DD70AFB6B9DEC4BC52DA2D27F6A5175DA944E67133C1D183490
0.55.0
x6428766FB75AD0F1A046A9F86D0D81398A484DC88003CB09D33063B6E45F65E00C
0.54.1
x647259A235660AC837EFCC848AE6A9E6394C767931D7E27E11621AE9F413DB68E7
0.54.0
x64766B9BE6224E7ACD118196014C2562BBD8ABAADD0A414A3FB5F83A32B0B068DC
0.53.0
x645D168D53F0ED6B87A61EA96FD7AECE7DC53B05D6DEB6D50CFCC3E778DAD340F0