pymacos
A Pythonic interface to macOS. Notifications, clipboard, dark mode, apps, Keychain, speech, screenshots, battery, volume, Shortcuts, Finder, Spotlight, dialogs and system info, all from one import with 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="Olá") # 'Hello'
macos.finder.trash("old.log") # moved to the Trash
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: nothing is 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.3.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 | |
|---|---|---|---|
| pymacos-1.3.0.tar.gz | 63.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pymacos-1.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 103.9 kB
Release files / pymacos-1.3.0.tar.gz
| Download URL | pymacos-1.3.0.tar.gz |
|---|---|
| Size | 63.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9427da44115e32ee91b2ddec303e23a5afb01a4ba012b12e5c8106148b2bc6c1
|
|
BLAKE2b-256 checksum How to use checksums |
6d6890d3affbe8bc5633512bfbdd4458159022b289d94d6acd4c36e5b6803cd4
|
| 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 Sep 27, 2026.
Transparency logRelease files / pymacos-1.3.0-py3-none-any.whl
| Download URL | pymacos-1.3.0-py3-none-any.whl |
|---|---|
| Size | 40.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a14dc528afa3835e50cec103c839c4204bda88fa97066ec93bf975254e78f5e0
|
|
BLAKE2b-256 checksum How to use checksums |
5d4236c6d3782eebb1431d326aaa617c37f079b2f85173d179bc20c65356ad8a
|
| 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 Sep 27, 2026.
Transparency log