JeanExtreme002/pymacos
JeanExtreme002/pymacos has 30 GitHub stars and 3 forks. Star changes are not measured yet. Last checked 2026-11-18 07:07 UTC. Last push 2026-11-14.
Measured star growth
- in 24h
- Update delayed
- in 7 days
- Collecting history
- in 15 days
- Collecting history
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
About
A Python library for automating and controlling macOS.
ProductivityREADME.md
Original
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.