Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

adrenaline

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

adrenaline

Keep your OS from sleeping (supports Windows and macOS)

  • 3.0.0
  • PyPI
  • Socket score

Maintainers
1

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.

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc