Skip to content
This repository was archived by the owner on Apr 1, 2023. It is now read-only.

Corvan/py-ip-command

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

py-ip-command

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-command
pipenv install py-ip-command

Note

This is still work in progess, but you can already use it. Help is very welcome!

Usage

At the moment only two commands of ip are implemented.

Just use

from ip_command.ip import IP

and then you can issue commands like

ip addr show

with

IP.addr.show()

or

ip neigh show

with

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=True to show() or simply call show(True)

About

A Python (3.7+) wrapper for the Linux ip command

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages