{"id":21547,"library":"mac-alias","title":"mac-alias","description":"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.","status":"active","version":"2.2.3","language":"python","source_language":"en","source_url":"https://github.com/dmgbuild/mac_alias","tags":["macos","alias","dmg"],"install":[{"cmd":"pip install mac-alias","lang":"bash","label":"Default install"}],"dependencies":[],"imports":[{"note":"The Alias class is in the mac_alias package.","symbol":"Alias","correct":"from mac_alias import Alias"}],"quickstart":{"code":"from mac_alias import Alias\n\n# Create an Alias from a file path (requires macOS)\nalias = Alias.from_path('/Applications')\n# Serialize to bytes\nalias_bytes = alias.to_bytes()\n\n# Later, read alias and resolve\nalias2 = Alias.from_bytes(alias_bytes)\npath = alias2.to_path()\nprint(path)","lang":"python","description":"Create a macOS Alias from a file path, serialize to bytes, and resolve later."},"warnings":[{"fix":"Only use this library on macOS; use conditional imports or platform checks.","message":"macOS-only: mac-alias works on macOS only. It will fail on Linux/Windows with an OSError or import errors for underlying macOS frameworks.","severity":"gotcha","affected_versions":"all"},{"fix":"Always check if result is None before using the path.","message":"alias.to_path() may return None if the target no longer exists. The alias data can still be valid but resolution fails silently.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'2.2.3':13 '3.10':16 'alia':3,8,35 'cadenc':27 'creat':21 'disk':23 'dmg':36 'dmgbuild':19,32 'ecosystem':33 'generat':4 'imag':24 'mac':2 'mac-alia':1 'maco':7,22,34 'maintain':28 'pars':6 'part':30 'python':11,15 'record':9 'releas':26 'stabl':25 'support':14 'use':17 'version':12","created_at":"2026-04-27T17:00:28.864885+00:00","updated_at":"2026-04-27T17:00:28.864885+00:00","problems":[{"fix":"Install with 'pip install mac-alias' and import 'from mac_alias import Alias'.","cause":"Package not installed or wrong import path. Some older docs reference 'mac_alias' as 'mac_alias'.","error":"ImportError: No module named 'mac_alias'"},{"fix":"Ensure the path exists before calling from_path().","cause":"Alias.from_path() expects an existing file or folder on disk. Non-existent paths raise this error.","error":"OSError: [Errno 2] No such file or directory: '/path/to/file'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"2.2.3","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/dmgbuild/mac_alias","docs":"https://mac-alias.readthedocs.io/en/latest/","changelog":null,"pypi":"https://pypi.org/project/mac-alias/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["serialization"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-06-28","next_check":"2026-07-28","install_tag":null}}