Skip to main content

Pywol

A Wake-on-LAN tool written in Python.

MIT license PyPI PyPI - Python Version PyPI - Wheel CircleCI branch Documentation Status

Pywol allows for starting up WoL-enabled systems over a network1, and can either be used as a CLI tool or imported for use in other Python code.

Installation

$ pip install pywol

Usage examples

As a CLI tool:

$ pywol 1A2B3C4D5E6F --v
Sent magic packet for '1A2B3C4D5E6F' to 255.255.255.255:9.
$
$ pywol 1A:2B:3C:4D:5E:6F --v --ip 192.168.1.5/24
Sent magic packet for '1A:2B:3C:4D:5E:6F' to 192.168.1.255:9.
$
$ pywol --help
Usage: pywol [OPTIONS] MAC_ADDRESS

  CLI for the Pywol package.

  Prefer to specify the IPv4 broadcast address of the target host's
  subnet over the default '255.255.255.255'.

  To automatically resolve the broadcast address of a subnet,
  specify the target host's IPv4 address along with its netmask. E.g.
  '192.168.1.5/24' or '192.168.1.5/255.255.255.0' --> '192.168.1.255'

Options:
  --ip_address, --ip TEXT  IPv4 broadcast address or host address with
                            netmask.  [default: 255.255.255.255]
  --port, --p INTEGER      Target port.  [default: 9]
  --verbose, --v
  --help                   Show this message and exit.

Imported for use in other code:

>>> from pywol import wake
>>>
>>> wake("1A2B3C4D5E6F", ip_address="192.168.1.255")
>>> wake("1A-2B-3C-4D-5E-6F", ip_address="192.168.1.5/24", return_dest=True)
('192.168.1.255', '9')
>>>

Documentation

Additional documentation is available at https://pywol.readthedocs.io/en/latest/.

Development setup

Clone repo:

$ git clone https://github.com/erberlin/pywol.git
$ cd pywol

Create and activate virtual environment on OS X & Linux:

$ python3 -m venv venv
$ source venv/bin/activate

Create and activate virtual environment on Windows:

> python -m venv venv
> venv\Scripts\activate

Install development requirements:

$ pip install -r dev_requirements.txt

Run test suite:

$ pytest -v

Why create another WoL tool?

I needed one and this was an opportunity to learn some stuff.

Meta

Erik R Berlin - erberlin.dev@gmail.com

Distributed under the MIT license. See LICENSE for more information.

https://github.com/erberlin/pywol


1. Provided that any routers between the client and target hosts are configured to forward broadcast packets.

Metadata

Release files for pywol 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pywol 1.0.0
File Size Uploaded
pywol-1.0.0.tar.gz 4.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pywol 1.0.0
File Interpreter ABI Platform
pywol-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 11.0 kB

Release files / pywol-1.0.0.tar.gz

Download URL pywol-1.0.0.tar.gz
Size 4.6 kB
Tags Source
SHA-256 checksum
How to use checksums
f07535f282f84729add5affd2079c16a6a9048f534129fdbac9d46ddc8313f39
BLAKE2b-256 checksum
How to use checksums
a42b27c164ff9c4d42db17ea15ff7f583d4974a181f33b1e7af5b8eaf58ee6e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

Release files / pywol-1.0.0-py3-none-any.whl

Download URL pywol-1.0.0-py3-none-any.whl
Size 6.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b3529c278a10c11a1d38ab11635f2c644d48dda138de0cb8fb36a21f621e0148
BLAKE2b-256 checksum
How to use checksums
e95eb348407426c981cc5afa41a9fb00ee13f9c0cdfe5611bed0a893774364b7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

0.5.0

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page