CSV Processing in the Terminal:
10 CLI Commands, Zero Dependencies

Tutorial · evolver-tools v38.0.2 · Estimated read: 8 minutes

You have a CSV file. You need to analyze it — filter rows, compute stats, maybe merge it with another file. The typical answer: open Python, pandas, Jupyter. But what if you could do it all from the terminal, without installing a single dependency?

This tutorial uses evolver-tools — a zero-dependency CLI toolkit you install once: pip install evolver-tools. Every command shown here works on Linux, macOS, and Windows. No pandas, no numpy, no database. Just pure Python stdlib under the hood.

Let's start with a sample dataset and work through real-world tasks.

pip install evolver-tools
262 CLI tools · zero external dependencies · all platforms

Sample Data: Sales Records

Save this as sales.csv — we'll use it throughout the tutorial:

# sales.csv — 20 rows of sample sales data
date,product,region,units,price,currency
2025-01-05,Widget A,North,12,19.99,USD
2025-01-05,Widget B,South,5,34.50,USD
2025-01-06,Widget A,East,8,19.99,USD
2025-01-06,Gadget X,North,3,89.00,USD
2025-01-07,Widget B,West,15,34.50,USD
2025-01-07,Gadget X,South,7,89.00,USD
2025-01-08,Widget A,North,20,19.99,USD
2025-01-08,Gadget X,East,4,89.00,USD
2025-01-09,Widget B,North,10,34.50,USD
2025-01-09,Gadget X,West,6,89.00,USD
2025-01-10,Widget A,South,14,19.99,USD
2025-01-10,Widget B,East,9,34.50,USD
2025-01-11,Gadget X,North,11,89.00,USD
2025-01-11,Widget A,West,7,19.99,USD
2025-01-12,Widget B,South,18,34.50,USD
2025-01-12,Gadget X,East,5,89.00,USD
2025-01-13,Widget A,North,22,19.99,USD
2025-01-13,Gadget X,West,8,89.00,USD
2025-01-14,Widget B,North,13,34.50,USD
2025-01-14,Widget A,East,16,19.99,USD

Now let's explore what we can do with this data.

1. Preview the Data — csv-preview

See the first 5 rows with column headers:

$ cat sales.csv | evtool csv-preview
date       product   region  units  price  currency
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2025-01-05 Widget A  North     12   19.99  USD
2025-01-05 Widget B  South      5   34.50  USD
2025-01-06 Widget A  East       8   19.99  USD
2025-01-06 Gadget X  North      3   89.00  USD
2025-01-07 Widget B  West      15   34.50  USD

csv-preview automatically detects column widths and shows a clean, aligned table. No configuration needed.

Pro tip: Almost every evolver-tools command accepts piped input. This composability is the Unix philosophy done right — connect tools with |.

2. Count Rows — csv-stats

Get descriptive statistics for every column:

$ cat sales.csv | evtool csv-stats
─── Column Statistics ───
Total rows: 20

date:
  type: date
  unique: 10
  min: 2025-01-05
  max: 2025-01-14

product:
  type: text
  unique: 2
  top: Widget A (9)

region:
  type: text
  unique: 4
  top: North (6)

units:
  type: integer
  mean:   10.3
  min:     3
  max:    22
  sum:   206

price:
  type: float
  mean:   45.12
  min:    19.99
  max:    89.00

currency:
  type: text
  unique: 1
  value:  USD

csv-stats infers column types automatically — dates, numbers, text — and gives you the summary in one command.

3. Filter Rows — csv-filter

Find all Widget A sales with more than 10 units:

$ cat sales.csv | evtool csv-filter "product == 'Widget A' and units > 10"
date,product,region,units,price,currency
2025-01-08,Widget A,North,20,19.99,USD
2025-01-10,Widget A,South,14,19.99,USD
2025-01-13,Widget A,North,22,19.99,USD
2025-01-14,Widget A,East,16,19.99,USD

The filter syntax supports ==, !=, >, <, >=, <=, and, or, not, in, and matches (regex).

4. Select Columns — csv-select

Need only the product, units, and price columns?

$ cat sales.csv | evtool csv-select product units price
product,units,price
Widget A,12,19.99
Widget B,5,34.50
Widget A,8,19.99
Gadget X,3,89.00
...

5. Aggregate by Group — csv-group

Total units sold per product, across all regions:

$ cat sales.csv | evtool csv-group product --agg sum:units,mean:price
product,units_sum,price_mean
Gadget X,44,89.0
Widget A,99,19.99
Widget B,70,34.5

This is equivalent to a SQL GROUP BY — but without installing a database.

6. Sort Data — csv-sort

Sort by units descending, then by date ascending:

$ cat sales.csv | evtool csv-sort units:desc date:asc
date,product,region,units,price,currency
2025-01-08,Widget A,North,20,19.99,USD
2025-01-13,Widget A,North,22,19.99,USD
2025-01-05,Widget A,North,12,19.99,USD
...

7. Join Two CSV Files — csv-join

Create a product catalog:

# products.csv
product,category,margin
Widget A,Hardware,0.45
Widget B,Hardware,0.52
Gadget X,Electronics,0.38
$ cat sales.csv | evtool csv-join products.csv product
date,product,region,units,price,currency,category,margin
2025-01-05,Widget A,North,12,19.99,USD,Hardware,0.45
2025-01-05,Widget B,South,5,34.50,USD,Hardware,0.52
...

Now every sale row includes the product category and margin — all with one command. This is what would normally require a JOIN in SQL or merge() in pandas.

8. Compute Revenue — csv-eval

Add a calculated column for total revenue (units × price):

$ cat sales.csv | evtool csv-eval "revenue = round(units * price, 2)"
date,product,region,units,price,currency,revenue
2025-01-05,Widget A,North,12,19.99,USD,239.88
2025-01-05,Widget B,South,5,34.50,USD,172.5
...

You can chain this with other commands — pipe the result into csv-group to get total revenue by product:

$ cat sales.csv | evtool csv-eval "revenue = round(units * price, 2)" | evtool csv-group product --agg sum:revenue
product,revenue_sum
Gadget X,3916.0
Widget A,1979.01
Widget B,2415.0

9. Search All Rows — csv-grep

Find every sale involving "North" region, highlight the match:

$ cat sales.csv | evtool csv-grep North
date       product   region  units  price  currency
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2025-01-05 Widget A  North    12   19.99  USD
2025-01-06 Gadget X  North     3   89.00  USD
2025-01-08 Widget A  North    20   19.99  USD
2025-01-09 Widget B  North    10   34.50  USD
2025-01-11 Gadget X  North    11   89.00  USD
2025-01-13 Widget A  North    22   19.99  USD
2025-01-14 Widget B  North    13   34.50  USD

10. Visualize as Bar Chart — csv-chart

Create a terminal-based bar chart of revenue by product:

$ cat sales.csv | evtool csv-eval "revenue = round(units * price, 2)" | evtool csv-group product --agg sum:revenue | evtool csv-chart
Gadget X   ████████████████████████████████████████ 3916.00
Widget B   ████████████████████████████▌            2415.00
Widget A   █████████████████████▉                    1979.01

No matplotlib, no JavaScript. A bar chart, right in your terminal, from piped CSV data.

Putting It All Together

Here's the real power: a complete data pipeline in a single line:

$ cat sales.csv | evtool csv-eval "revenue = round(units * price, 2)" | evtool csv-join products.csv product | evtool csv-group category --agg sum:revenue,sum:units | evtool csv-sort "revenue_sum:desc"
category,revenue_sum,units_sum
Hardware,4394.01,137
Electronics,3916.0,44

What just happened:

  1. csv-eval — computed revenue per row
  2. csv-join — enriched sales with product categories
  3. csv-group — aggregated by category
  4. csv-sort — ranked by highest revenue

6 seconds. No Python script. No Jupyter. No pandas.

Why this matters: When you're in the middle of debugging, exploring a dataset, or building a pipeline — being able to type your analysis directly in the terminal keeps you in flow. No context switching, no waiting for imports.

Why Not Just Use Python + Pandas?

Scenario pandas evolver-tools
Install pip install pandas (20+ deps, ~50MB) pip install evolver-tools (0 deps, pure stdlib)
Quick preview df.head() (start Python first) evtool csv-preview < file.csv
Filter + group df[df.a > 5].groupby('b').sum() pipe | csv-filter | csv-group
In a pipeline Requires python -c wrapper Native pipe support
Zero-dependency deploy Heavy container image Works on Alpine, minimal Docker

pandas is powerful. But for interactive exploration, one-liner analysis, and pipeline integration — CLI tools are faster and more composable.

What's Next?

<<<<<<< HEAD

You've seen 10 commands. evolver-tools has 259 total — across categories like:

=======

You've seen 10 commands. evolver-tools has 258 total — across categories like:

>>>>>>> 1608f1debabdd173435d9e417b841e3b668004e0
Ready to try it?

pip install evolver-tools

evtool ascii-banner "Hello World"
That's it. 262 tools. Zero dependencies. All platforms.