Registry / pyobjc-framework-backgroundassets

pyobjc-framework-backgroundassets

JSON →
library12.2pypypiunverified

Python wrappers for the macOS BackgroundAssets framework, enabling applications to manage large asset downloads in the background. It is part of the comprehensive PyObjC project, which provides Python bindings for the entire macOS and iOS Cocoa frameworks. Version 12.1 is the latest stable release, with updates typically aligned with macOS SDK releases and Python version support.

pip install pyobjc-framework-backgroundassets
INSTALL
IMPORT
SIG · PYOBJC-FRAMEWORK-B
P
pyobjc-framework-backgroundassets
pythonv12.2
Install
—
Import
—
Disk
—
Pass rate
0/ 10
Env Coverage0 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v? · pip install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.920 runs
build_error
glibc
py 3.10–3.920 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

BAManager
✓ from BackgroundAssets import BAManager
BAURLDownload
✓ from BackgroundAssets import BAURLDownload
BAURLDownloadConfiguration
✓ from BackgroundAssets import BAURLDownloadConfiguration
NSURL
✓ import Foundation

This example demonstrates how to create a `BAURLDownloadConfiguration` and a `BAURLDownload` object using the `BackgroundAssets` framework. Note that actually initiating and managing background downloads requires specific macOS application entitlements and a properly configured application delegate, which are outside the scope of a simple Python script.

import Foundation from BackgroundAssets import BAManager, BAURLDownload, BAURLDownloadConfiguration, BAURLDownloadNetworkActivityCellular # Get the shared manager instance manager = BAManager.sharedManager() # Create a configuration for the download config = BAURLDownloadConfiguration.new() config.setIdentifier_("com.example.mybackgrounddownload") # Unique identifier config.setDiscretionary_(True) # Allow system to decide when to run config.setRequiresPower_(False) # Does not require external power config.setRequiresNetworkActivity_(BAURLDownloadNetworkActivityCellular) # Or BAURLDownloadNetworkActivityAny, BAURLDownloadNetworkActivityWiFi # Create a URL for the download (replace with a real URL for testing) download_url_str = "https://example.com/some/large/file.zip" download_url = Foundation.NSURL.URLWithString_(download_url_str) # Create the download object # The last argument is an NSError** pointer; use None for Python in non-error cases download, error = BAURLDownload.downloadWithURL_configuration_error_(download_url, config, None) if download: print(f"Successfully created BAURLDownload: {download.identifier()}") print(f"Download URL: {download.URL().absoluteString()}") print(f"Configuration identifier: {download.configuration().identifier()}") # To actually schedule it, you'd add it to the manager. This often requires # specific macOS entitlements and an application lifecycle. # For a simple runnable snippet, just creating the objects is sufficient. # success, error_add = manager.addDownload_error_(download, None) # if success: print(f"Added download to manager.") # else: print(f"Failed to add download: {error_add}") else: print(f"Failed to create BAURLDownload: {error}")
Debug
Known issues
breakingPyObjC has dropped support for older Python versions in recent releases. Python 3.9 support was dropped in v12.0, and Python 3.8 support was dropped in v11.0.
fix
Ensure your project uses Python 3.10 or later for PyObjC v12.x, or Python 3.9 or later for PyObjC v11.x.
affects: >=11.0
gotchaPyObjC is a macOS-specific library and will not work on other operating systems. Furthermore, `pyobjc-core` is a compiled extension and requires a compatible Python version and macOS architecture (e.g., Apple Silicon vs. Intel).
fix
Develop and run PyObjC projects exclusively on macOS. If encountering installation issues, ensure your Python installation matches your macOS architecture and that Xcode command-line tools are installed (`xcode-select --install`).
affects: all
breakingPyObjC 11.1 introduced changes to align Automatic Reference Counting (ARC) behavior for initializer methods with Clang's documentation. This can affect how custom Objective-C classes, or classes subclassed in Python, handle object references during initialization.
fix
Review initialization logic for any Python-defined Objective-C classes, especially those overriding `init...` methods, to ensure correct reference counting and object lifetime management.
affects: >=11.1
gotchaThe BackgroundAssets framework, like many macOS background services, typically requires specific application entitlements (e.g., `com.apple.developer.background-downloads`) configured in your Xcode project for full functionality. Without these, downloads may not proceed.
fix
When developing a macOS application using BackgroundAssets, ensure the necessary entitlements are added to your application's `Info.plist` or Xcode project settings. Simple Python scripts run without an application bundle may have limited functionality.
affects: all
Upgrade
Version history
12.2latest on PyPI · released May 30, 2026
Audit
Dependencies
pyobjc-corerequiredProvides the core bridge between Python and Objective-C, essential for all PyObjC framework bindings.
pyobjc-framework-FoundationoptionalProvides core macOS Foundation classes like NSURL, often used in conjunction with other frameworks.
Agent activity
2 hits · last 30 days
node
2
Resources
pyobjc-framework-backgroundassets — pip install pyobjc-framework-backgroundassets · libregistry