Skip to main content

A small python module for wake on lan.

Project description

Pypi version Supported Python versions Build Status Documentation Status Code coverage

A small python module for wake on lan.

For more information on the wake on lan protocol please take a look at Wikipedia.

Installation

pip install wakeonlan

Usage

To wake up a computer using wake on lan it must first be enabled in the BIOS settings. Please note the computer you are trying to power on does not have an ip address, but it does have a mac address. The package needs to be sent as a broadcast package.

As a Python Module

Import the module

>>> from wakeonlan import send_magic_packet

Wake up a single computer by its mac address

>>> send_magic_packet('ff.ff.ff.ff.ff.ff')

Wake up a single computer by its mac address with a SecureOn password

>>> send_magic_packet('ff.ff.ff.ff.ff.ff/01:23:45:67:89:ab')

Wake up multiple computers by their mac addresses.

>>> send_magic_packet('ff.ff.ff.ff.ff.ff',
...                   '00-00-00-00-00-00',
...                   'FFFFFFFFFFFF')

An external host may be specified. Do note that port forwarding on that host is required. The default ip address is 255.255.255.255 and the default port is 9.

>>> send_magic_packet('ff.ff.ff.ff.ff.ff',
...                   ip_address='example.com',
...                   port=1337)

A network adapter may be specified. The magic packet will be routed through this interface.

>>> send_magic_packet('ff.ff.ff.ff.ff.ff',
...                   interface='192.168.0.2')

As a Standalone Script

$ wakeonlan --help
usage: wakeonlan [-h] [-6] [-i IP] [-p PORT] [-n INTERFACE] mac address [mac address ...]

Wake one or more computers using the wake on lan protocol.

positional arguments:
  mac address           The mac addresses or "mac address/secureon password" tuples of the computers you are trying to wake.

options:
  -h, --help            show this help message and exit
  -6, --ipv6            To indicate if ipv6 should be used by default instead of ipv4. (default: False)
  -i IP, --ip IP        The ip address of the host to send the magic packet to. (default: 255.255.255.255)
  -p PORT, --port PORT  The port of the host to send the magic packet to. (default: 9)
  -n INTERFACE, --interface INTERFACE
                        The ip address of the network adapter to route the magic packet through. (default: None)

Compatibility

This project works with Python 3.7 or greater.

License

MIT © Remco Haszing

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wakeonlan-3.3.0.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wakeonlan-3.3.0-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file wakeonlan-3.3.0.tar.gz.

File metadata

  • Download URL: wakeonlan-3.3.0.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for wakeonlan-3.3.0.tar.gz
Algorithm Hash digest
SHA256 80ec2163ecb3a091c6fa655e5e3106968ceaa4541ed90afa6391d1011fef71f2
MD5 e145e77b754b96ff82a162415f59c2c6
BLAKE2b-256 0b69073906a5a1eedf2e6a36d284456e9fba43e9063f910d202778dab6f96799

See more details on using hashes here.

Provenance

The following attestation bundles were made for wakeonlan-3.3.0.tar.gz:

Publisher: ci.yaml on remcohaszing/pywakeonlan

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file wakeonlan-3.3.0-py3-none-any.whl.

File metadata

  • Download URL: wakeonlan-3.3.0-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for wakeonlan-3.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 969d4e1f30add1a79790c99350e91c46ed45588770416257a3f806ca0314b17a
MD5 3ce60f00d3e8ea9f867afea2610d2663
BLAKE2b-256 a6abd1a60da2f2c46a022ef15caaabe5bc468519c05dc855a0a40a83cb656c26

See more details on using hashes here.

Provenance

The following attestation bundles were made for wakeonlan-3.3.0-py3-none-any.whl:

Publisher: ci.yaml on remcohaszing/pywakeonlan

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page