Use this module to prevent your Mac OS X system from sleeping while executing a long-running python script.
Quick Start
Just import caffeine. That’s it! You Mac OS X system will not sleep as long as the interpreter remains alive. No need to run any other commands. But if you want slightly finer controls, a few functions are available.
caffeine.on(display=False)
Use the on function to create a power assertion. Set display=True to also keep your display from sleeping. The default of display=False will allow your display to sleep but will keep your system awake so processing can continue. If a power assertion is active, calling on() with display set to the other value will change the assertion. Calling on() with the same value is a harmless no-op.
caffeine.off()
Use the off function to release any power assertion before your interpreter exits.
caffeine.verify()
Calls pmset -g assertions to verify what power assertions are active.
Metadata
Release files for caffeine 0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| caffeine-0.5.tar.gz | 2.4 kB | Without provenance | Details |
Release files / caffeine-0.5.tar.gz
| Download URL | caffeine-0.5.tar.gz |
|---|---|
| Size | 2.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
40092894e2e79652ec2ed7a41508ff3b06b60e041ad42c86ff54d64220332d3a
|
|
BLAKE2b-256 checksum How to use checksums |
66baacd2d55744d86142c533c6c73412c5aa0387467f8f75aa3d62a86c866fe8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for caffeine 0.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.