Cross-platform utility package for MDM deployment scripts (Jamf Pro, Intune).
Project description
pymdm
A Python utility package for macOS MDM deployment scripts, built for MacAdmins Python (#!/usr/local/bin/managed_python3) and Jamf Pro workflows. Windows/Intune support is included for teams managing mixed-platform fleets.
What's Included
| Feature | macOS (Jamf) | Windows (Intune) |
|---|---|---|
| JamfParamParser | Yes | -- |
| IntuneParamParser | -- | Yes |
| GenericParamParser | Yes | Yes |
| Dialog (swiftDialog) | Yes | Graceful no-op |
| CommandRunner | Yes | Yes |
| TextTools | Yes | Yes |
| SystemInfo | Yes | Yes |
| MdmLogger | Yes | Yes |
| WebhookSender | Yes | Yes |
| DarwinDefaults | Yes | -- |
| DarwinServiceManager | Yes | -- |
| Win32Registry | -- | Yes |
| Win32ServiceManager | -- | Yes |
See the User Guide for what each piece does.
[!NOTE] Windows/Intune support is experimental. The Windows code paths are unit-tested but have not yet been validated on real Windows hardware. Treat them as a starting point rather than a guarantee. Bug reports and contributions from Windows/Intune admins are very welcome.
Installation
pip install pymdm[requests]
requests is an optional extra because the primary target, MacAdmins managed_python3, already bundles it, so a plain pip install pymdm is enough there. The uv, source, and fleet-deployment paths are in the installation guide.
Quick Example (macOS / Jamf Pro)
#!/usr/local/bin/managed_python3
"""Example Jamf Pro policy script."""
from pymdm import MdmLogger, CommandRunner, SystemInfo, WebhookSender
from pymdm.mdm import get_provider
params = get_provider("jamf") # explicit; get_provider() now defaults to GenericParamParser
logger = MdmLogger(debug=params.get_bool(4), output_path="/var/log/my_script.log")
runner = CommandRunner(logger=logger)
logger.log_startup("my_script", version="1.0.0")
try:
serial = SystemInfo.get_serial_number()
hostname = SystemInfo.get_hostname()
logger.info(f"Running on {hostname} ({serial})")
output = runner.run(["/usr/bin/sw_vers", "-productVersion"])
logger.info(f"macOS version: {output}")
webhook = WebhookSender(url=params.get(5), logger=logger)
webhook.send(hostname=hostname, serial=serial, status="success")
except Exception as e:
logger.log_exception("Script failed", e, exit_code=1)
Windows/Intune, platform helpers, and per-module usage live in the Quick Start.
Development
git clone https://github.com/liquidz00/pymdm.git
cd pymdm
make install-dev # dev dependencies (includes docs tooling)
make test
make format
make help # list every target
See CONTRIBUTING to get started, and the CHANGELOG for release notes and version migration steps.
Requirements
- Python 3.12+
requests(bundled with MacAdmins Python)
License
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pymdm-0.7.0.tar.gz.
File metadata
- Download URL: pymdm-0.7.0.tar.gz
- Upload date:
- Size: 52.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
32174b2bae34f9ad9be216d64f60d96b67dea3d2d463a8701f9e649c2c4ac082
|
|
| MD5 |
6848c5fb61131710ee6bcd9e9d853a63
|
|
| BLAKE2b-256 |
a451051febb89c6adaba952d68f7547b62d5163d1ce872039c87691f57656011
|
Provenance
The following attestation bundles were made for pymdm-0.7.0.tar.gz:
Publisher:
build-release.yml on liquidz00/pymdm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pymdm-0.7.0.tar.gz -
Subject digest:
32174b2bae34f9ad9be216d64f60d96b67dea3d2d463a8701f9e649c2c4ac082 - Sigstore transparency entry: 2011157727
- Sigstore integration time:
-
Permalink:
liquidz00/pymdm@5beb79e6b85f441347e49ccfa006efb03812dec0 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/liquidz00
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build-release.yml@5beb79e6b85f441347e49ccfa006efb03812dec0 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file pymdm-0.7.0-py3-none-any.whl.
File metadata
- Download URL: pymdm-0.7.0-py3-none-any.whl
- Upload date:
- Size: 40.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eee7131abf7d87b532304d0471c71bea27e5fc202af31cd87928edf99b89200b
|
|
| MD5 |
d0dd656dfeb301fcf00b2ccc81674dba
|
|
| BLAKE2b-256 |
0247238af5eecb738d073ee4efdce74d65adeee5490d4eca229def0d657329dc
|
Provenance
The following attestation bundles were made for pymdm-0.7.0-py3-none-any.whl:
Publisher:
build-release.yml on liquidz00/pymdm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pymdm-0.7.0-py3-none-any.whl -
Subject digest:
eee7131abf7d87b532304d0471c71bea27e5fc202af31cd87928edf99b89200b - Sigstore transparency entry: 2011157859
- Sigstore integration time:
-
Permalink:
liquidz00/pymdm@5beb79e6b85f441347e49ccfa006efb03812dec0 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/liquidz00
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build-release.yml@5beb79e6b85f441347e49ccfa006efb03812dec0 -
Trigger Event:
workflow_dispatch
-
Statement type: