Metadata-Version: 2.4
Name: csvmagic
Version: 2.5.0
Summary: CSV Utilities
Home-page: https://github.com/markuskimius/csvmagic
Author: Mark Kim
Author-email: markuskimius+py@gmail.com
License: Apache 2.0
Keywords: csv,text
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: getopts
Requires-Dist: wcwidth
Requires-Dist: importlib_resources
Dynamic: author
Dynamic: author-email
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license
Dynamic: license-file
Dynamic: requires-dist
Dynamic: summary

# csvmagic
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)
[![Release](https://img.shields.io/github/v/release/markuskimius/csvmagic?include_prereleases&label=Release)](https://github.com/markuskimius/csvmagic/releases)

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

[Apache 2.0]

[csvread]: https://github.com/markuskimius/csvmagic/blob/master/doc/csvread.md
[csvcut]: https://github.com/markuskimius/csvmagic/blob/master/doc/csvcut.md
[csvalign]: https://github.com/markuskimius/csvmagic/blob/master/doc/csvalign.md
[csvsql]: https://github.com/markuskimius/csvmagic/blob/master/doc/csvsql.md
[csvcsv]: https://github.com/markuskimius/csvmagic/blob/master/doc/csvcsv.md
[csvgrep]: https://github.com/markuskimius/csvmagic/blob/master/doc/csvgrep.md
[csvjson]: https://github.com/markuskimius/csvmagic/blob/master/doc/csvjson.md
[Apache 2.0]: <https://github.com/markuskimius/csvmagic/blob/master/LICENSE>
[dpm]: <https://github.com/markuskimius/dpm>
