Skip to content

ronreiter/pyclitool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

py CLI tool

py is a command line utility that allow you to map/filter/reduce your input with a Python one liner, line by line.

Installing:

sudo pip install pyclitool

Usage:

Here are some powerful examples of what you can do with the py command line utility.

Calculate the length of the file names in your current directory:

ls | py "len(x)"

Sum a list of numbers using a reduce function:

echo -n "1\n2\n3\n4\n5\n" | py -r "int(x)+int(y)"

Filter only lines from a CSV which the sixth column is greater than 3, skipping the header row of the CSV

cat wine_data.csv | py -s -f "float(x.split(',')[5]) > 3.0"

Author:

Ron Reiter <ron.reiter@gmail.com>

About

py is a command line utility that allow you to map/filter/reduce your input with a Python one liner, line by line.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages