Goulash as a library
Apart from command-line usage, goulash
is also a toolbox/utility module. Random examples:
- The
goulash._os.makedirs
hasmkdir -p dir_name
functionality (almost-but-not-quite whatos.makedirs
does 1) - The
goulash.reflect
module has "import python object from string" functionality without all the hassle of__import__
orimportlib
2. - How about that missing
@classproperty
decorator? 3
The entire library will probably never be documented, but this page will just cover some of the highlights.n a lot of cases, I've just adapted
Of course the goulash command-line utilities can also be used componentwise from the library. Or look over here! It's a quick and dirty HTTP fileserver that's actually multithreaded.
But it pretty much goes on like this forever..
Missing from the OS
module
Decorator patterns
>>> from tunl import api
>>> api.list_tunnels()
{'mongo': {'local_port': 27000,
'remote_host': 'host',
'remote_port': 27017,
'status': 'down',
'user': 'admin'},
'jenkins': {'key': '~/.ssh/key.pem',
'local_port': 8081,
'remote_host': 'jenkins',
'remote_port': 8080,
'status': 'down',
'user': 'ubuntu'}}
>>> start_success = api.start_tunnel('mongo')
tunl: ssh -M -S /home/vagrant/.tunl/mongo -fnNT -L 27000:localhost:27017 admin@host
>>> print start_success
True
Caching & Memoization
Contributing
Github is here. Pull requests welcome.
Running tests
To run the unittests:
$ cd tunl
$ source venv/bin/activate
$ pip install tox
$ tox
Building documentation
To rebuild this documentation:
$ cd tunl
$ source venv/bin/activate
$ pip install tox
$ tox -e docs_deploy