Skip to main content

Keep your OS from sleeping (supports Windows and macOS)

Project description

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.

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

adrenaline-4.0.1.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

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

adrenaline-4.0.1-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file adrenaline-4.0.1.tar.gz.

File metadata

  • Download URL: adrenaline-4.0.1.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.14

File hashes

Hashes for adrenaline-4.0.1.tar.gz
Algorithm Hash digest
SHA256 0bf0ddae21f77ac2d23463ad63e21ecb93e725c837030ca3d488a8bc21981727
MD5 2b70657e710e07fded639f20aa27b007
BLAKE2b-256 b4615ecb453599685e3738701e92b69746dbb0fd822a874e1a2487c136c6ea68

See more details on using hashes here.

File details

Details for the file adrenaline-4.0.1-py3-none-any.whl.

File metadata

  • Download URL: adrenaline-4.0.1-py3-none-any.whl
  • Upload date:
  • Size: 8.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.14

File hashes

Hashes for adrenaline-4.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 685ca576ad4d86881a60264da537afb6832c8a62c42bd3411513ba19820f2cb9
MD5 d40d622bc31dee66e1c8663c29662292
BLAKE2b-256 7bb6e251fcff64ec55f95394889562ce9b155b73bbf90060e08494cd928b5789

See more details on using hashes here.

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