A small network utility library written in Python 3.
Features:
- Port scanner
- UPnP client (SSDP wrapper)
Build with ❤️ by
Oleaintueri is sponsoring the development and maintenance of this project within their organisation.
pip install pyphorus
Or
pip install git+https://github.com/Oleaintueri/pyphorus.git
import pyphorus
if __name__ == "__main__":
phorus = pyphorus.Pyphorus()
devices = phorus.scan_ports("192.168.0.1", ports=[80, 443, 9000], only_open=True)
for device in devices:
print(device.ip, device.port)
# get all devices with ssdp:all
devices = phorus.scan_upnp("upnp:rootdevice")
for device in devices:
print(device.ip, device.friendly_name, device.device_type)
# if you want only the unique ips to remain and are not interested in the ports
unique_devices = pyphorus.utils.strip_duplicate_ips(devices)
Pyphorus uses nose
to run its tests and mock testing server.
nosetests -v