csvmagic
Command line utilities to work with csv files.
Contents
- csvread - Display csv rows in a more human-readable format.
- csvcut - Extract or rearrange columns of a csv file.
- csvgrep - Find rows matching a pattern in a csv file.
- csvalign - Print a csv file with its columns aligned.
- csvsql - Query one or more csv files.
- csvcsv - Convert a csv file from one variant to another.
- csvjson - Convert a csv file to json.
Installation
With pip:
pip install csvmagic
With dpm:
dpm install https://github.com/markuskimius/csvmagic.git
With git clone, after installing the dependencies with pip:
pip install getopts
git clone https://github.com/markuskimius/csvmagic.git
CSV Format
All utilities share the same parser:
- The delimiter is guessed from the comma, tab, pipe, and SOH (ASCII 1) characters, or it may be specified explicitly.
- A field that begins with a double quote is a quoted field. It may contain
the delimiter and newlines, and a double quote inside it is written as two
double quotes (
""). - Any other field is taken literally up to the next delimiter, including any double quotes it contains. This allows values such as unquoted JSON to appear in a field:
firstname text lastname
hello { "hello" : "world" } world!
Testing
PATH="$PWD/bin:$PATH" test/test.sh
The test script requires bash 4 or later. It exits with a non-zero status if any test fails.
License
Metadata
Release files for csvmagic 2.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| csvmagic-2.5.0.tar.gz | 323.6 kB | Details |
Release files / csvmagic-2.5.0.tar.gz
| Download URL | csvmagic-2.5.0.tar.gz |
|---|---|
| Size | 323.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e30baddbc2415e2fe4cc39bc3ce3505c743626a297a73c1363134e9a4af74312
|
|
BLAKE2b-256 checksum How to use checksums |
a8b2821fafb9d93f97f47834e34b36470f943c57743b9c23c3ad9c234189d5f0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.7
|