dmgbuild
macOS command line utility to build disk images
What it is and what it does
dmgbuild is a Python wrapper around macOS disk image creation tools that lets you build .dmg files programmatically with customized appearance. Instead of using Finder or the low-level hdiutil command, you define the disk image layout and styling in Python, then dmgbuild handles the creation. It depends on two small libraries—ds_store and mac_alias—to manipulate the metadata that controls how the disk image appears when opened.
The package is designed for developers and build systems that need to package macOS applications or distribute software as polished disk images. It's actively maintained, supports modern Python versions, and carries no known vulnerabilities. Because it wraps macOS-specific system tools, it only runs on macOS and cannot be used for cross-platform builds.
Use it for:
- Automate creation of branded .dmg installers for macOS applications in CI/CD pipelines
- Package and distribute macOS software with consistent, professional presentation
- Generate disk images programmatically as part of a build or release workflow
- Control disk image metadata and layout through Python configuration instead of GUI tools
- Create customized disk image layouts without manual Finder interaction
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
dmgbuild creates macOS disk images (.dmg files) from the command line with full control over appearance, without relying on Finder or deprecated APIs.
Yes, if you develop or package for macOS. dmgbuild solves a real problem—creating polished disk images without Finder—with low install friction, active maintenance, MIT licensing, and no known vulnerabilities. It's only useful on macOS, so Windows and Linux developers can skip it entirely.
Install
dmgbuild on PyPI
pip
pip install dmgbuilduv
uv add dmgbuildpoetry
poetry add dmgbuildInstalling dmgbuild
Before you install
Low friction install with only two runtime dependencies. Active maintenance with recent commits and stable production status.
License in practice
MIT license permits unrestricted use, modification, and distribution with minimal legal constraints.
Quickstart
pip install dmgbuild
from dmgbuild import build_dmg
build_dmg('output.dmg', 'source_folder')
macOS only—dmgbuild wraps macOS-specific tools and cannot run on Windows or Linux.
Verify before relying
- What configuration options are available for customizing disk image appearance (window size, background, icon layout)
- Whether the package supports programmatic configuration beyond command-line invocation
- Specific examples of appearance customization in published documentation
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — ds_store, mac_alias |
| Maintenance | actively maintained — 211 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 147,036/month — #11,082 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: dmgbuild-1.6.7-py3-none-any.whl
Keywords: dmg
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
developer-disk-imageFetches Apple's DeveloperDiskImage files…
copyleft · top 15,000 on PyPI
mac-aliasmac_alias generates and reads binary Alias and…
permissive · top 15,000 on PyPI
pyobjc-framework-DiskArbitrationProvides Python bindings to macOS's…
permissive · top 15,000 on PyPI
buildkite-sdkA Python SDK for interacting with Buildkite's…
unclear · top 15,000 on PyPI
ds-storeRead and modify macOS Finder .DS_Store files…
permissive · top 15,000 on PyPI
universal-startfileProvides a cross-platform wrapper around…
permissive · top 15,000 on PyPI
flet-cliFlet CLI is a command-line tool for creating,…
permissive · top 15,000 on PyPI
iterm2Provides a Python scripting interface to…
copyleft · top 15,000 on PyPI
macholibAnalyzes and edits Mach-O headers, the…
permissive · top 5,000 on PyPI
python-editorProgrammatically open your system's $EDITOR…
permissive · top 5,000 on PyPI