A module that reads JSON files of Jamf resources (IDs) and deletes them
Project description
Jamf Resource Deleter
Safely delete unused or disabled resources from Jamf Pro using structured JSON input and the Jamf Pro API.
This tool is designed to work alongside tools like Prune, allowing you to identify unused Jamf resources, export them as JSON, and then programmatically remove them from your Jamf Pro tenant.
⚠️ Warning
This tool permanently deletes Jamf Pro resources.
- There is no undo
- Always validate your JSON input
- Always test against a non-production Jamf tenant first
- Review the resources to be deleted before running
You are responsible for the changes made by this tool.
Features
- Deletes unused or disabled Jamf Pro resources via API
- Supports multiple JSON input files
- Clear naming conventions and predictable behavior
- Uses the JamfPy Python SDK
- Designed for automation and CI/CD usage
- Works with output generated by Prune
Supported Resource Types
The exact supported resources depend on JamfPy API coverage, but typically include:
- Policies
- Scripts
- Extension Attributes
- Computer Groups
- Mobile Device Groups
- Configuration Profiles
- Packages (optional / configurable)
(See JamfPy documentation for supported endpoints.)
How It Works
- You identify unused or disabled Jamf resources (e.g. with Prune)
- Export those resources into one or more JSON files
- Provide the JSON files to
jamf-resource-deleter - The module (alongside JamfPy):
- Authenticates to Jamf Pro
- Iterates through each resource
- Deletes it via the Jamf Pro API
Example
import os
from jamf_resource_deleter.jamf_resource_deleter import JamfResourceDeleter
import jamfpy
client_id = "YOUR-CLIENT-ID"
client_secrent = "YOUR-CLIENT-SECRET"
jamfpro_url = "https://your-jamfpro-server.com"
jamfpy_client = jamfpy.Tenant(
fqdn = jamfpro_url,
auth_method="oauth2",
client_id=client_id,
client_secret=client_secrent,
token_exp_threshold_mins=1
)
deleter = JamfResourceDeleter(jamfpy_client)
deleter.delete_from_json("PATH-TO-JSON-File")
Installation
Requirements
- Python 3.9+
- Jamf Pro account with API permissions
- Jamf Pro API credentials
- Network access to your Jamf tenant
Install from PyPi
pip install jamf-resource-deleter
Install from source (development)
git clone https://github.com/your-org/jamf-resource-deleter.git
cd jamf-resource-deleter
pip install -e .
Dependencies
This project uses:
- JamfPy – Jamf Pro Python SDK
requests- Standard Python libraries
JamfPy is installed automatically as a dependency.
Authentication
Authentication is handled by JamfPy.
You can create a JamfPy client using the following:
import jamfpy
client_id = "YOUR-CLIENT-ID"
client_secrent = "YOUR-CLIENT-SECRET"
jamfpro_url = "https://your-jamfpro-server.com"
jamfpy_client = jamfpy.Tenant(
fqdn = jamfpro_url,
auth_method="oauth2"
client_id=client_id,
client_secret=client_secrent,
token_exp_threshold_mins=1
)
Refer to the JamfPy documentation for supported authentication methods.
Input JSON Format
You may supply one or more JSON files.
JSON structure
Each file must contain an array of objects with at minimum:
resourceType- Jamf Pro resource typeid– Jamf Pro resource IDname– Human-readable name (used for logging / validation)
Example
{
"unusedComputerProfiles": [{
"id": 12,
"name": "Restrictions"
}]
}
Each resource type has to match the following naming convention, this table is also the supported resources at time of writing:
| JSON Key | Jamf Resource Type | Delete Method |
|---|---|---|
unusedComputerGroups |
Computer Groups | _delete_computer_group |
unusedMacApps |
macOS Applications | _delete_apps |
unusedMobileDeviceApps |
Mobile Device Applications | _delete_apps |
unusedPackages |
Packages | _delete_packages |
unusedPolicies |
Policies | _delete_policies |
unusedComputerProfiles |
Computer Configuration Profiles | _delete_profiles |
unusedScripts |
Scripts | _delete_scripts |
unusedComputerEAs |
Computer Extension Attributes | _delete_computer_extension_attributes |
unusedRestrictedSoftware |
Restricted Software | _delete_restricted_software |
Project details
Release history Release notifications | RSS feed
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 jamf_resource_deleter-0.4.4.tar.gz.
File metadata
- Download URL: jamf_resource_deleter-0.4.4.tar.gz
- Upload date:
- Size: 10.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f7d95a47843cfbb8de03828c773a2071ce4905f66e6a9b5f302e7408c5c31564
|
|
| MD5 |
b514f17040da4cb27626daf693b2f183
|
|
| BLAKE2b-256 |
bb2cdeb469c13d5ca6c893d9c2e8978daab37def826f3a3aa7947004953a8398
|
Provenance
The following attestation bundles were made for jamf_resource_deleter-0.4.4.tar.gz:
Publisher:
release-please.yml on macdeacon99/jamfpro-resource-deleter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jamf_resource_deleter-0.4.4.tar.gz -
Subject digest:
f7d95a47843cfbb8de03828c773a2071ce4905f66e6a9b5f302e7408c5c31564 - Sigstore transparency entry: 809396701
- Sigstore integration time:
-
Permalink:
macdeacon99/jamfpro-resource-deleter@e0d4234b47f9c6ee86966833fd8a92902ddb49df -
Branch / Tag:
refs/heads/main - Owner: https://github.com/macdeacon99
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-please.yml@e0d4234b47f9c6ee86966833fd8a92902ddb49df -
Trigger Event:
push
-
Statement type:
File details
Details for the file jamf_resource_deleter-0.4.4-py3-none-any.whl.
File metadata
- Download URL: jamf_resource_deleter-0.4.4-py3-none-any.whl
- Upload date:
- Size: 10.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6db922ce10ad6e64013a5e9123d984ab68a0204241c69452cd7a42d3cfc1e9a9
|
|
| MD5 |
3df998cf934c5211abb1c3da7f376ccd
|
|
| BLAKE2b-256 |
507b3c368f969a428c0dc44518a1804bf42f86bbe8f3e772f323f633ad31dab6
|
Provenance
The following attestation bundles were made for jamf_resource_deleter-0.4.4-py3-none-any.whl:
Publisher:
release-please.yml on macdeacon99/jamfpro-resource-deleter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jamf_resource_deleter-0.4.4-py3-none-any.whl -
Subject digest:
6db922ce10ad6e64013a5e9123d984ab68a0204241c69452cd7a42d3cfc1e9a9 - Sigstore transparency entry: 809396706
- Sigstore integration time:
-
Permalink:
macdeacon99/jamfpro-resource-deleter@e0d4234b47f9c6ee86966833fd8a92902ddb49df -
Branch / Tag:
refs/heads/main - Owner: https://github.com/macdeacon99
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-please.yml@e0d4234b47f9c6ee86966833fd8a92902ddb49df -
Trigger Event:
push
-
Statement type: