Skip to main content

Swiss Army csv: command-line tools to manipulate csv-formatted data

Project description

sacsv: Swiss Army csv

Swiss Army csv (based on Andrew Toskin's photo distributed under CC BY-SA 4.0)

This Python package provides an assortment of command-line tools to manipulate csv-formatted data. The tools are:

  • csv2jsonl: converts csv input into jsonlines
  • csvaddrandom: adds a column with a random number
  • csvadduniqueid: adds a column with a unique record identifier
  • csvaggregate: applies an arbitrary Python function to every value of a column, possibly within groups
  • csvappend: appends two or more csv files
  • csvdropdups: drops duplicate records
  • csvfindsortkey: attempts to find the column that the input is sorted by
  • csvkeepmax: keeps the record that has the maximum value in a column
  • csvleftjoin: merges two csv files
  • csvop: applies an arbitrary Python function to every record and saves the return value in a new column
  • csvparallel: parallelizes arbitrary commands that read a csv input and write a csv output
  • csvrename: changes the name of a column
  • csvreorder: changes the order of columns
  • csvsed: applies a substitution rule, using regular expressions, to every value of a column
  • csvsort: sorts the input
  • csvtranspose: transposes the input
  • fw2csv: converts fixed-width input, potentially with multi-line records, into csv
  • longcsv2wide: converts the input from long to wide form
  • widecsv2long: converts the input from wide to long form

Illustration of csvparallel executing f.py in 8 jobs

Installation

To install this package using uv, type

uv tool install sacsv

or using pip,

pip install git+https://github.com/gn0/sacsv

or, alternatively,

git clone https://github.com/gn0/sacsv
pip install ./sacsv

Author

Gabor Nyeki. Contact information is on http://www.gabornyeki.com/.

License

This package is licensed under the Creative Commons Attribution 4.0 International License: http://creativecommons.org/licenses/by/4.0/.

The picture at the top of this README is based on Andrew Toskin's 2014 photo which is distributed under CC BY-SA 4.0.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sacsv-1.5.2.tar.gz (13.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sacsv-1.5.2-py3-none-any.whl (15.5 kB view details)

Uploaded Python 3

File details

Details for the file sacsv-1.5.2.tar.gz.

File metadata

  • Download URL: sacsv-1.5.2.tar.gz
  • Upload date:
  • Size: 13.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for sacsv-1.5.2.tar.gz
Algorithm Hash digest
SHA256 7127804e1ae02e793faf59afd158d7423e4f51c6a9cf30589d3abd9b0775c865
MD5 5ddd791c790a2b00258ab59b485a6f58
BLAKE2b-256 bffd4a729c390952f9415ee0900dee8daa235526085f8cf4620202bffe5439c3

See more details on using hashes here.

File details

Details for the file sacsv-1.5.2-py3-none-any.whl.

File metadata

  • Download URL: sacsv-1.5.2-py3-none-any.whl
  • Upload date:
  • Size: 15.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for sacsv-1.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 71d5c6ef9d8992f430d70a01444c26eb4fa9f987ec145ecb9ca82938a258b9cd
MD5 3795c2b9c8887faf254f0e1776da2b9c
BLAKE2b-256 324f59babd7d5cb898d4acd390ecb316872050f7c6ac89b3f217e0c2c350af1c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page