skillfed

appnope

Disable App Nap on macOS >= 10.9

appnope v0.1.4 9.8M downloads/30d#1,500 on PyPI58
Permissive license BSD Active released

What it is and what it does

appnope is a lightweight utility for macOS developers who need to prevent the operating system from throttling their Python applications. On macOS >= 10.9, the App Nap feature automatically reduces CPU and I/O for backgrounded applications to save power, which can cause performance problems for long-running tasks. appnope wraps the native NSProcessInfo API using ctypes to temporarily disable App Nap around critical code sections.

The package provides three ways to control App Nap: a simple toggle function to disable it globally, a function to re-enable it, and a context manager for scoped disabling. It has no external dependencies and installs as a pure Python wheel, making it trivial to add to any macOS-based project that needs predictable performance during intensive operations.

Use it for:

  • Prevent App Nap during long-running data processing or scientific computations on macOS.
  • Ensure consistent performance for background services or daemons running on macOS systems.
  • Disable App Nap around critical test suites or benchmarks to avoid timing interference.
  • Protect specific code blocks from throttling while keeping App Nap enabled elsewhere in the application.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Disables App Nap on macOS >= 10.9 to prevent performance degradation during long-running operations, using ctypes to wrap NSProcessInfo system calls.

Yes, if you develop or run Python applications on macOS that perform long-running or performance-sensitive tasks. The package is actively maintained, has no dependencies, and solves a real macOS-specific problem. Not relevant for non-macOS environments.

Install

appnope on PyPI

pip

pip install appnope

uv

uv add appnope

poetry

poetry add appnope

Installing appnope

Before you install

Low friction install with no runtime dependencies. Actively maintained as of 2026-08-03.

License in practice

BSD license is permissive; you can use this package freely in commercial and open-source projects with minimal restrictions.

Quickstart

pip install appnope

import appnope
appnope.nope()  # disable App Nap

# or use as context manager
with appnope.nope_scope():
    do_important_stuff()

macOS >= 10.9 required; package is macOS-only and will not function on other operating systems.

Verify before relying

  • Whether App Nap behavior or system integration has changed in recent macOS versions beyond 10.9

Package facts

License BSD (permissive)
Python support supports the current Python release (>=3.6)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance actively maintained — 920 days since the last release
Last repo commit
First released
Downloads 9,808,896/month — #1,500 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: appnope-0.1.4-py2.py3-none-any.whl

License :: OSI Approved :: BSD LicenseOperating System :: MacOS :: MacOS XProgramming Language :: Python :: 3

Tags

disable app nap macosmacos performance degradationprevent app nap pythonmacos system activity controllong-running tasks macosnsprocessinfo wrapper
macos-specificperformance-tuning

More Utilities packages