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-3.0.0.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

adrenaline-3.0.0-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: adrenaline-3.0.0.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.12.1 Darwin/23.2.0

File hashes

Hashes for adrenaline-3.0.0.tar.gz
Algorithm Hash digest
SHA256 a770f620881939ea3345aa07c2fc0712a16f792f0814783c65fbd0d8d6a04988
MD5 01cc49723d431db34768f490ff4e5a75
BLAKE2b-256 0ecc8347f41026b36c64d63a68d5a69be4f26b8c40419a4526246597287478f8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: adrenaline-3.0.0-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.12.1 Darwin/23.2.0

File hashes

Hashes for adrenaline-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 726261d4ca2e3b19c24a517256198d879d16ba95ae8bea7ccaca540cefcbf42d
MD5 5b9b6751d9a3ecd28d2de3eb39e8923a
BLAKE2b-256 ab1bd1d132be2b1e7ff5b0ea096d14f0902a8334b7801266a0c4d2ddbdde23dd

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page