This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Coreutils-like kit for headed tab-separated files processing

Project Description

A CLI TSV MR kit (a command-line interface tab-separated values map-reduce kit). Powered by coreutils.

Overview

$ cat fruits | tpretty

 fruit   | price:float
---------+-------------
 apple   | 1.04
 kumquat | 4.99
 orange  | 2.07

$ cat sales | tpretty

 fruit   | qty:int | paid:bool
---------+---------+-----------
 apple   | 10      | 1
 apple   | 7       | 0
 apple   | 1       | 1
 orange  | 3       | 1
 orange  | 18      | 1
 orange  | 4       | 0
 orange  | 2       | 1
 kumquat | 1       | 1
 kumquat | 2       | 1

$ cat sales \
        | tmap_awk -f paid \
        | tsrt -k fruit \
        | tjoin -j fruit - fruits \
        | tgrp_awk -g fruit -o "sum_qty=sum(qty)" -o "sum_paid=sum(qty*price)" \
        | tpretty

 fruit   | sum_qty:int | sum_paid:float
---------+-------------+----------------
 apple   | 11          | 11.44
 kumquat | 3           | 14.97
 orange  | 23          | 47.61

tcat

Concatenate FILE(s), or standard input, to standard output.

1.tsv:

# apples    oranges
1   foo
2   bar

2.tsv:

# apples    oranges
3   baz
4   bam
$ tcat 1.tsv 2.tsv
# apples    oranges
1   foo
2   bar
3   baz
4   bam

tcut

Print selected columns from each FILE to standard output.

input.csv:

# good  bad also_good
1   apple   foo
2   orange  bar
3   lemon   baz
$ cat input.csv | tcut -f good,also_good
#   good    also_good
1   foo
2   bar
3   baz

tsrt

Write sorted concatenation of all FILE(s) to standard output.

input.csv:

# number    fruit
10  apple
3   orange
10  lemon
$ cat input.csv | tsrt -k good:num,fruit:desc
# number    fruit   # ORDER: number:num, fruit:desc
3   orange
10  lemon
10  apple

tmap_awk

Perform a map operation on the input FILE(s).

input.csv:

# x
.1
4
-0.5
0
$ cat input.csv | tmap_awk -f 'x>0' -o 'y=log(x)'
# y:float
-2.30259
1.38629
Release History

Release History

This version
History Node

0.13

History Node

0.12

History Node

0.11

History Node

0.10

History Node

0.9

History Node

0.8

History Node

0.7

History Node

0.6

History Node

0.5

History Node

0.4

History Node

0.3

History Node

0.2

History Node

0.1

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
tabkit-0.13-py2.7.egg (43.3 kB) Copy SHA256 Checksum SHA256 2.7 Egg Nov 2, 2016
tabkit-0.13.tar.gz (14.6 kB) Copy SHA256 Checksum SHA256 Source Nov 2, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting