CLI framework using python

vijnaana bhairava vijnaana at gmail.com
Tue Oct 14 09:33:10 EDT 2014


Hi Folks,

The requirement is to develop a CLI framework in python for a linux router.
The suggestions i got is to use PyCli/Cliff. Not sure which would be the right choice!  Also, a few APIs are mentioned here: 

https://pythonhosted.org/pyCLI/#module-cli.app

Since i couldn't find any actual implementation which uses pyCli,
i can't figure out how to make use of pyCLI.

Another question i have is whether it uses argparse?
If so, what value add does PYCLI do?

Regards,
vij

On Thursday, October 9, 2014 5:50:51 PM UTC+5:30, vijnaana bhairava wrote:
> Hi,
> 
> 
> 
> I need to develop a python CLI framework.
> 
> 
> 
> For example if i need to set an ip address in linux:
> 
> 
> 
> ifconfig eth0 172.16.25.125
> 
> 
> 
> I should be able to use python to do the above.
> 
> 
> 
> 1. The user will execute a python script to which i will pass the params eth0 and ip address (something like ifconf.py  eth0 172.16.25.125)
> 
> 
> 
> 2. Within the script i grab the params and do something to the effect of user executing 'ifconfig eth0 172.16.25.125' from the shell.
> 
> 
> 
> 3. There are other such commands for which i will be using python scripts. I came across pyCLI, but it doesn't have much documentation, so couldn't figure out how to move forward.
> 
> 
> 
> 4. The CLI framework needs to reuse code so i didn't want to use pure python and develop a framework from scratch. Rather use something like pyCLI/CLIFF.
> 
> 
> 
> The problem is lack of documentation with examples on how to use the above.
> 
> 
> 
> Any guidance would be greatly appreciated.
> 
> 
> 
> Regards & Thanks,
> 
> Vij



More information about the Python-list mailing list