Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/niedbalski/python-act_as_executable
Python wrapper to transform a function into an executable call, Very useful for constructing wrappers to CLI interfaces.
https://github.com/niedbalski/python-act_as_executable
Last synced: about 1 month ago
JSON representation
Python wrapper to transform a function into an executable call, Very useful for constructing wrappers to CLI interfaces.
- Host: GitHub
- URL: https://github.com/niedbalski/python-act_as_executable
- Owner: niedbalski
- Created: 2013-04-19T15:33:41.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-12-16T17:32:52.000Z (about 9 years ago)
- Last Synced: 2024-10-15T08:32:58.349Z (3 months ago)
- Language: Python
- Homepage:
- Size: 2.93 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
act_as_executable
=================Python wrapper to make a method to call an executable before its called.
Very useful wrapper for constructing wrappers on top of CLI interfaces.Installation
============```
pip install act_as_executable
```Example
=======```python
from act_as_executable import act_as_executable
class CommandWrapper:
@act_as_executable('ifconfig -i $arg_0 --state $state')
def ifconfig(self, *args, **results):
'''
{ 'results' : 'command_output' }
'''
return resultsc = CommandWrapper()
c.ifconfig('eth0', state='down')```