adrenaline
Simple Python module to prevent your computer from going to sleep. Supports Windows and macOS at the moment; Linux support is coming soon (hopefully).
Usage
The module provides a context manager named prevent_sleep(). The computer
will not go to sleep while the execution is in this context:
from adrenaline import prevent_sleep
with prevent_sleep():
# do something important here
...
Optionally, you can also prevent the screen from turning off:
with prevent_sleep(display=True):
# do something important here
...
Command line interface
You can also use this module from the command line as follows:
$ python -m adrenaline
The command line interface will prevent sleep mode as long as it is running.
Acknowledgments
Thanks to Michael Lynn for figuring out how to do this on macOS.
Thanks to Niko Pasanen for the Windows version.
Metadata
Release files for adrenaline 4.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| adrenaline-4.0.1.tar.gz | 5.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| adrenaline-4.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.2 kB
Release files / adrenaline-4.0.1.tar.gz
| Download URL | adrenaline-4.0.1.tar.gz |
|---|---|
| Size | 5.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0bf0ddae21f77ac2d23463ad63e21ecb93e725c837030ca3d488a8bc21981727
|
|
BLAKE2b-256 checksum How to use checksums |
b4615ecb453599685e3738701e92b69746dbb0fd822a874e1a2487c136c6ea68
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.14
|
Release files / adrenaline-4.0.1-py3-none-any.whl
| Download URL | adrenaline-4.0.1-py3-none-any.whl |
|---|---|
| Size | 8.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
685ca576ad4d86881a60264da537afb6832c8a62c42bd3411513ba19820f2cb9
|
|
BLAKE2b-256 checksum How to use checksums |
7bb6e251fcff64ec55f95394889562ce9b155b73bbf90060e08494cd928b5789
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.14
|