Wrapping the Linux ip command in Python.
Find me on pypi: https://pypi.org/project/py-ip-command/
on GitHub: https://github.com/Corvan/py-ip-command
or install me:
pip install py-ip-commandpipenv install py-ip-commandThis is still work in progess, but you can already use it. Help is very welcome!
At the moment only two commands of ip are implemented.
Just use
from ip_command.ip import IPand then you can issue commands like
ip addr showwith
IP.addr.show()or
ip neigh showwith
IP.neigh.show()The return of both is
- An object oriented representation of the data reurned by both commands
- a dict (addr) or a list of dicts (neigh) consisting of all the information the commands return but split
into single elements, if you pass
as_dict=Truetoshow()or simply callshow(True)