I've built something along these lines, Object Shell: <a href="http://geophile.com/osh" rel="nofollow">http://geophile.com/osh</a>, (GPL license). Object Shell provides for piping of python objects between commands. For example,<p><pre><code> bash-3.2$ osh ls -f ^ select 'f: f.size > 20000' $
('./.DS_Store',)
('./.psql_history',)
('./backup.log',)
('./loljack.jpg',)
</code></pre>
osh invokes the interpreter. ls is osh's ls command. The -f flag restricts the ls command to files. ^ is the osh pipe character, so the list of files in the current directory is piped to the next command. select filters out objects that don't pass the predicate, in this case, that file.size > 20000. $ renders output (using python's str()).<p>osh also does database access, e.g.<p><pre><code> osh sql "select * from my_table" $
</code></pre>
and remote access. E.g., to run the same query on every node of a cluster named foobar:<p><pre><code> osh @foobar [ sql "select count(*) from my_table" ] $
</code></pre>
Piping python tuples between commands and then operating on them from the command line is really handy.<p>Object Shell also has a python API, e.g.<p><pre><code> #!/usr/bin/python
from osh.api import *
osh(remote('foobar',
sql("select count(*) from my_table")),
out())</code></pre>