Skip to main content

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.

📖 Full documentation →

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

License

Apache 2.0

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

pymdm-0.7.0.tar.gz (52.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pymdm-0.7.0-py3-none-any.whl (40.1 kB view details)

Uploaded Python 3

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

Hashes for pymdm-0.7.0.tar.gz
Algorithm Hash digest
SHA256 32174b2bae34f9ad9be216d64f60d96b67dea3d2d463a8701f9e649c2c4ac082
MD5 6848c5fb61131710ee6bcd9e9d853a63
BLAKE2b-256 a451051febb89c6adaba952d68f7547b62d5163d1ce872039c87691f57656011

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymdm-0.7.0.tar.gz:

Publisher: build-release.yml on liquidz00/pymdm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for pymdm-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eee7131abf7d87b532304d0471c71bea27e5fc202af31cd87928edf99b89200b
MD5 d0dd656dfeb301fcf00b2ccc81674dba
BLAKE2b-256 0247238af5eecb738d073ee4efdce74d65adeee5490d4eca229def0d657329dc

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymdm-0.7.0-py3-none-any.whl:

Publisher: build-release.yml on liquidz00/pymdm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page