Skip to main content

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)

Source distribution for adrenaline 4.0.1
File Size Uploaded
adrenaline-4.0.1.tar.gz 5.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for adrenaline 4.0.1
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

4.0.1 This release

2 release files

3.0.0

2 release files

2.0.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.0.0

1 release file

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