A Pythonic interface to macOS
Control your whole Mac from Python: apps, notifications, input, screen, camera, microphone, OCR, media, Keychain, Touch ID and more, with one import and zero dependencies.
| docs |
|
|---|---|
| tests |
|
| package |
|
import macos
macos.notify("Build finished", title="CI")
macos.say("Done!")
macos.clipboard.copy("hello")
macos.appearance.is_dark() # True
macos.screenshot("screen.png")
macos.apps.open("Safari") # App(name='Safari', ...)
macos.keychain.get("my-app", "alice") # 's3cret'
macos.power.battery() # Battery(percent=87, charging=True, ...)
macos.shortcuts.run("Translate", input="Hola") # 'Hello'
macos.finder.trash("old.log") # moved to the Trash
What's inside
| Area | Topics |
|---|---|
| Apps & Automation | Apps, Browser, Clipboard, Events, Hotkeys, Keyboard, Maps, Menu Bar, Mouse, Music, Schedule, Shortcuts, Windows |
| User Interaction | Dialogs, Notifications, Sound, Speech |
| Files & Documents | Audio Files, Documents, Finder, Images, PDF, Spotlight, Video |
| Intelligence | Language, Vision |
| Security | Authentication, Keychain |
| System & Hardware | Appearance, Audio, Bluetooth, Camera, Defaults, Dock, Network, Power, Printer, Screen, Settings, System, Time Machine, Trackpad, Volume |
Install
pip install pymacos
The package is installed as pymacos and imported as macos.
Requires macOS and Python 3.9+.
Why
A notification from plain Python means AppleScript inside a string, which breaks as soon as the message contains a quote:
subprocess.run(["osascript", "-e", 'display notification "Build finished" with title "CI"'])
With pymacos:
macos.notify("Build finished", title="CI")
Across the whole package:
- No dependencies: no PyObjC, nothing to compile.
- Plain, typed functions that return Python objects.
- Any text is safe: your text is never pasted into shell or AppleScript source.
- Clear errors when macOS is missing a permission, instead of silent failures.
See Why pymacos? for a longer comparison.
Documentation
The full guide and API reference are at macos.readthedocs.io.
License
Released under the MIT License — free for personal and commercial use.
Not affiliated with or endorsed by Apple Inc. macOS is a trademark of Apple Inc.
Metadata
Release files for pymacos 1.35.0
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 | Actions |
|---|---|---|---|---|
| pymacos-1.35.0.tar.gz | 832.1 kB | With provenance | Details for pymacos-1.35.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pymacos-1.35.0-py3-none-any.whl | Python 3 | none | any | Details for pymacos-1.35.0-py3-none-any.whl |
Total release size: 1.3 MB
Release files / pymacos-1.35.0.tar.gz
| Download URL | pymacos-1.35.0.tar.gz |
|---|---|
| Size | 832.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7859d5c2de8ea9cc57c30a92d0fa53ebc232fcc3a87b3d02a3b24abfda452a89
|
|
BLAKE2b-256 checksum How to use checksums |
d9e889f3a64cc3667457d8320b4e0d5424dd23c04855997c31bc4f811ffdbd33
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.
Transparency logRelease files / pymacos-1.35.0-py3-none-any.whl
| Download URL | pymacos-1.35.0-py3-none-any.whl |
|---|---|
| Size | 432.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ec79c6d804bc1874cc85919ebabd803b99f3c04068b544647fbfd16e8c327852
|
|
BLAKE2b-256 checksum How to use checksums |
7209d586c00702d7b4d8ecc2a44f831dcbab25e6b6971aaeb1879dddc0641aff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.
Transparency logSecurity for pymacos 1.35.0
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for pymacos-1.35.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.
Transparency logA 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.