Skip to content

benwhalley/statpipe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Statpipe

Statpipe is a simple command line utility allowing Stata commands to be piped into Stata, and the output returned. 2 For example:

echo "di 2+2" | statpipe
. di 2^2
4

You can also use in interactive mode (although state isn't saved across calculations):

statpipe
> Enter a stata expression (e.g. di 2*2):
di 2*2
> Cached output re-used
> . di 2*2
> 4

Or from a Python script you can import and use like so:

from statpipe import run_stata_code
print run_stata_code("di 2+2").split("\n")
> ['. di 2+2', '4', '']

To install, download and:

cd statpipe
python setup.py install #you might need to sudo if installing in system python

or

pip install statpipe

Dependencies

Obviously depends on Stata.

Tested with version 12 through 14 on OS X. Should work for Linux/Unix too.

About

Pipe commands to Stata and capture output.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages