Python api docs

Small module for use with the wake on lan protocol.

wakeonlan.create_magic_packet(macaddress: str) bytes

Create a magic packet.

A magic packet is a packet that can be used with the for wake on lan protocol to wake up a computer. The packet is constructed from the mac address given as a parameter.

Parameters:

macaddress – the mac address that should be parsed into a magic packet.

wakeonlan.main(argv: List[str] | None = None) None

Run wake on lan as a CLI application.

wakeonlan.send_magic_packet(*macs: str, ip_address: str = '255.255.255.255', port: int = 9, interface: str | None = None, address_family: AddressFamily | None = None) None

Wake up computers having any of the given mac addresses.

Wake on lan must be enabled on the host device.

Parameters:

macs – One or more macaddresses of machines to wake.

Keyword Arguments:
  • ip_address – the ip address of the host to send the magic packet to.

  • port – the port of the host to send the magic packet to.

  • interface – the ip address of the network adapter to route the magic packet through.

  • address_family – the address family of the ip address to initiate connection with. When not specificied, chosen automatically between IPv4 and IPv6.