csview 0.3.1

A high performance csv viewer with cjk/emoji support.
csview-0.3.1 is not a library.

Usage

$ cat example.csv
Year,Make,Model,Description,Price
1997,Ford,E350,"ac, abs, moon",3000.00
1999,Chevy,"Venture ""Extended Edition""","",4900.00
1999,Chevy,"Venture ""Extended Edition, Very Large""",,5000.00
1996,Jeep,Grand Cherokee,"MUST SELL!
air, moon roof, loaded",4799.00

$ csview example.csv
+------+-------+----------------------------------------+------------------------+---------+
| Year | Make  | Model                                  | Description            | Price   |
+------+-------+----------------------------------------+------------------------+---------+
| 1997 | Ford  | E350                                   | ac, abs, moon          | 3000.00 |
| 1999 | Chevy | Venture "Extended Edition"             |                        | 4900.00 |
| 1999 | Chevy | Venture "Extended Edition, Very Large" |                        | 5000.00 |
| 1996 | Jeep  | Grand Cherokee                         | MUST SELL!             | 4799.00 |
|      |       |                                        | air, moon roof, loaded |         |
+------+-------+----------------------------------------+------------------------+---------+

$ head -n10 /etc/passwd | csview --no-headers -d:
+------------------------+---+-------+-------+----------------------------+-----------------+
| root                   | x | 0     | 0     |                            | /root           |
| bin                    | x | 1     | 1     |                            | /               |
| daemon                 | x | 2     | 2     |                            | /               |
| mail                   | x | 8     | 12    |                            | /var/spool/mail |
| ftp                    | x | 14    | 11    |                            | /srv/ftp        |
| http                   | x | 33    | 33    |                            | /srv/http       |
| nobody                 | x | 65534 | 65534 | Nobody                     | /               |
| dbus                   | x | 81    | 81    | System Message Bus         | /               |
| systemd-journal-remote | x | 982   | 982   | systemd Journal Remote     | /               |
| systemd-network        | x | 981   | 981   | systemd Network Management | /               |
+------------------------+---+-------+-------+----------------------------+-----------------+

Run csview --help to view detailed usage.

Benchmark

Compared with csvlook provided by csvkit:

Benchmark #1: csvlook sample.csv
  Time (mean ± σ):      4.010 s ±  0.100 s    [User: 3.945 s, System: 0.051 s]
  Range (min … max):    3.911 s …  4.249 s    10 runs

Benchmark #2: csview sample.csv
  Time (mean ± σ):      46.5 ms ±   2.3 ms    [User: 39.7 ms, System: 6.5 ms]
  Range (min … max):    44.0 ms …  59.4 ms    59 runs

Summary
  'csview sample.csv' ran
   86.32 ± 4.83 times faster than 'csvlook sample.csv'
Benchmark #1: csvlook action.csv
  Time (mean ± σ):     316.5 ms ±   5.2 ms    [User: 284.8 ms, System: 35.0 ms]
  Range (min … max):   309.3 ms … 326.2 ms    10 runs

Benchmark #2: csview action.csv
  Time (mean ± σ):       0.7 ms ±   0.2 ms    [User: 0.8 ms, System: 0.7 ms]
  Range (min … max):     0.4 ms …   1.6 ms    933 runs

Summary
  'csview action.csv' ran
  461.25 ± 109.34 times faster than 'csvlook action.csv'

License

csview is distributed under the terms of both the MIT License and the Apache License 2.0.

See the LICENSE-APACHE and LICENSE-MIT files for license details.