Registry / serialization / mac-alias

mac-alias

JSON →
library2.2.3pypypi✓ verified 93d ago

Generate and parse macOS Alias records from Python. Version 2.2.3 supports Python >=3.10. Used by dmgbuild for creating macOS disk images. Stable release cadence, maintained as part of dmgbuild ecosystem.

pip install mac-alias
INSTALL
IMPORT
SIG · MAC-ALIAS
M
mac-alias
serializationpythonv2.2.3
Install
1.5s avg
Import
23ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v2.2.3 · pip install
no network on importno background threads
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.95 runs
installs and imports cleanly · install 0.0s · import 0.026s · 17.9MB
glibc
py 3.10–3.95 runs
installs and imports cleanly · install 1.5s · import 0.020s · 18MB
16MB installed
● package 16MB
Code
Verified usage

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

Alias
✓ from mac_alias import Alias
The Alias class is in the mac_alias package.

Create a macOS Alias from a file path, serialize to bytes, and resolve later.

from mac_alias import Alias # Create an Alias from a file path (requires macOS) alias = Alias.from_path('/Applications') # Serialize to bytes alias_bytes = alias.to_bytes() # Later, read alias and resolve alias2 = Alias.from_bytes(alias_bytes) path = alias2.to_path() print(path)
Debug
Known issues
gotchamacOS-only: mac-alias works on macOS only. It will fail on Linux/Windows with an OSError or import errors for underlying macOS frameworks.
fix
Only use this library on macOS; use conditional imports or platform checks.
affects: all
gotchaalias.to_path() may return None if the target no longer exists. The alias data can still be valid but resolution fails silently.
fix
Always check if result is None before using the path.
affects: all
Errors
Common errors & fixes
ImportError: No module named 'mac_alias'
Package not installed or wrong import path. Some older docs reference 'mac_alias' as 'mac_alias'.
fix
Install with 'pip install mac-alias' and import 'from mac_alias import Alias'.
OSError: [Errno 2] No such file or directory: '/path/to/file'
Alias.from_path() expects an existing file or folder on disk. Non-existent paths raise this error.
fix
Ensure the path exists before calling from_path().
Upgrade
Version history
2.2.3latest on PyPI · released Dec 4, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
10 hits · last 30 days
node
10
Resources
mac-alias — pip install mac-alias · libregistry