A small python module for wake on lan.
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
80ec2163ecb3a091c6fa655e5e3106968ceaa4541ed90afa6391d1011fef71f2
|
|
| MD5 |
e145e77b754b96ff82a162415f59c2c6
|
|
| BLAKE2b-256 |
0b69073906a5a1eedf2e6a36d284456e9fba43e9063f910d202778dab6f96799
|
Provenance
The following attestation bundles were made for wakeonlan-3.3.0.tar.gz:
Publisher:
ci.yaml on remcohaszing/pywakeonlan
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wakeonlan-3.3.0.tar.gz -
Subject digest:
80ec2163ecb3a091c6fa655e5e3106968ceaa4541ed90afa6391d1011fef71f2 - Sigstore transparency entry: 1629307806
- Sigstore integration time:
-
Permalink:
remcohaszing/pywakeonlan@7fc520f56e714262d176fdbc709cf8020299cd44 -
Branch / Tag:
refs/tags/3.2.0 - Owner: https://github.com/remcohaszing
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yaml@7fc520f56e714262d176fdbc709cf8020299cd44 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
969d4e1f30add1a79790c99350e91c46ed45588770416257a3f806ca0314b17a
|
|
| MD5 |
3ce60f00d3e8ea9f867afea2610d2663
|
|
| BLAKE2b-256 |
a6abd1a60da2f2c46a022ef15caaabe5bc468519c05dc855a0a40a83cb656c26
|
Provenance
The following attestation bundles were made for wakeonlan-3.3.0-py3-none-any.whl:
Publisher:
ci.yaml on remcohaszing/pywakeonlan
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wakeonlan-3.3.0-py3-none-any.whl -
Subject digest:
969d4e1f30add1a79790c99350e91c46ed45588770416257a3f806ca0314b17a - Sigstore transparency entry: 1629307832
- Sigstore integration time:
-
Permalink:
remcohaszing/pywakeonlan@7fc520f56e714262d176fdbc709cf8020299cd44 -
Branch / Tag:
refs/tags/3.2.0 - Owner: https://github.com/remcohaszing
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yaml@7fc520f56e714262d176fdbc709cf8020299cd44 -
Trigger Event:
push
-
Statement type: