Skip to main content

Query Apple Business Manager using Python

Project description

The purpose of this repo is to create a python library to easily get information using the Apple Business Manager API using Python.

A CLI command is also included, pyacm-cli.

https://developer.apple.com/documentation/applebusinessmanagerapi

Setup:

You will need to setup 2 environmental variables that are provided when creating the private key in ABM:

AXM_CLIENT_ID and AXM_KEY_ID

Place the private key in your home directory inside the .config/pyaxm folder and rename it key.pem

This location will be used to store a cached access_token that can be reused until it expires. While testing I have experienced that requesting too many access tokens will result in a response with status code 400 when trying to get a new token.

Installation:

pip install pyaxm

CLI:

pyaxm-cli -> returns commands available

pyaxm-cli devices -> returns all devices in ABM pyaxm-cli servers -> returns all servers in ABM pyaxm-cli device <serial_number> -> returns single device information pyaxm-cli server <server_id> -> returns all devices in that server pyaxm-cli mdm_server_assigned <serial_number> -> returns device assigned server id

The data returned is on CSV format so you can store it as a CSV if needed

Client:

Example usage:

axm_client = Client()

devices = axm_client.list_devices()
print(devices)

device = axm_client.get_device(device_id='SERIAL_NUMBER')
print(device)

mdm_servers = axm_client.list_mdm_servers()
print(mdm_servers)

# The MDM server ID can be extracted from listing all mdm servers
mdm_server = axm_client.list_devices_in_mdm_server(server_id="MDM_SERVER_ID")
print(mdm_server)

device_assigned_server = axm_client.list_devices_in_mdm_server(device_id='SERIAL_NUMBER')
print(device_assigned_server)

Issues:

  • need to add tests
  • not all api functionability is there

This is still a work in progress

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

pyaxm-2025.6.19.tar.gz (20.3 kB view details)

Uploaded Source

Built Distribution

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

pyaxm-2025.6.19-py3-none-any.whl (20.0 kB view details)

Uploaded Python 3

File details

Details for the file pyaxm-2025.6.19.tar.gz.

File metadata

  • Download URL: pyaxm-2025.6.19.tar.gz
  • Upload date:
  • Size: 20.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pyaxm-2025.6.19.tar.gz
Algorithm Hash digest
SHA256 ad70b96a521bb92f718c94cf04bd961511f9753cbd1102a0f6d66299b6ec06bd
MD5 e7ff39517e2254cc9ce361002170121f
BLAKE2b-256 921ccd71b291b977bcdddd551791883f37d855697d08d24cb1dd735e5f42cd77

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyaxm-2025.6.19.tar.gz:

Publisher: release.yml on kaincenteno/pyaxm

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

File details

Details for the file pyaxm-2025.6.19-py3-none-any.whl.

File metadata

  • Download URL: pyaxm-2025.6.19-py3-none-any.whl
  • Upload date:
  • Size: 20.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pyaxm-2025.6.19-py3-none-any.whl
Algorithm Hash digest
SHA256 ce95d8f3020e5ba780578e569c82f6789ae3d1c167427fe77b71e3fd1ed8848c
MD5 f28d917d9c7067bf25feb7b66ab1d91a
BLAKE2b-256 5e6051795131b12c6763db9e45ef4dcc1a6c9ae2705c094938e91ab173d4a72a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyaxm-2025.6.19-py3-none-any.whl:

Publisher: release.yml on kaincenteno/pyaxm

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