https://github.com/dougpenny/pyjamfpro
Synchronous python client for Jamf Classic/Pro API
https://github.com/dougpenny/pyjamfpro
jamf-pro jamf-pro-api python python3 requests
Last synced: 1 day ago
JSON representation
Synchronous python client for Jamf Classic/Pro API
- Host: GitHub
- URL: https://github.com/dougpenny/pyjamfpro
- Owner: dougpenny
- License: mit
- Created: 2022-03-25T15:21:02.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-09-07T19:38:43.000Z (9 months ago)
- Last Synced: 2025-05-31T22:35:37.386Z (17 days ago)
- Topics: jamf-pro, jamf-pro-api, python, python3, requests
- Language: Python
- Homepage:
- Size: 49.8 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README

[](https://pypi.org/project/pyjamfpro/)
[](https://pypi.org/project/pyjamfpro/)
[](https://opensource.org/licenses/MIT)PyJamfPro is a basic Python wrapper for synchronous communication with the [Jamf Pro (and/or Classic) API](https://developer.jamf.com/jamf-pro/docs). The goal is to simplify the process of communicating with the [Jamf Pro](https://www.jamf.com/products/jamf-pro/) device management server API by handling authentication and decoding, allowing you to focus on using the data, not retrieving it.
_PyJamfPro is not endorsed, sponsored, or affilitated with Jamf in any way._
***
## Usage
Begin by installing the PyJamfPro module, using `pip`.```shell
pip install pyjamfpro
```In your code, simply import the PyJamfPro module and instantiate a new client object. The constructor requires three arguments:
1. base_url - the base URL of your Jamf Pro server
2. client_id
3. client_secret
* _Note_: PyJamfPro uses [Client Credentials](https://developer.jamf.com/jamf-pro/docs/client-credentials) with your Jamf Pro server. You will need to ensure an [API Client](https://learn.jamf.com/en-US/bundle/jamf-pro-documentation-current/page/API_Roles_and_Clients.html) has been created with the correct permissions for the actions you would like to perform with the API.```python
from pyjamfpro import jamfproclient = jamfpro.Client('https://example.jamfserver.com', 'client_id', 'client_secret')
```Once you have a client, you can start making synchronous calls to the API.
```python
# returns list of all mobile devices, using the Classic API
devices = client.classic_mobile_devices()# returns a dictionary of inventory data for the mobile device with ID 1234,
# using the Classic API
device = client.classic_mobile_device_for_id(1234)# returns a list of all computers, using the Jamf Pro API
computers = client.pro_computers()
```Refer to the [`endpoints.py`](./src/pyjamfpro/endpoints.py) file for other built-in methods. Additionally, you can use the [`make_api_request`](./src/pyjamfpro/jamfpro.py#L121) method to access any Jamf API endpoint. Full support for GET, POST, PUT, and DELETE are included.
## Contributing
If you have a feature or idea you would like to see added to PyJamPro, please [create an issue](https://github.com/dougpenny/PyJamPro/issues/new) explaining your idea.Likewise, if you come across a bug, please [create an issue](https://github.com/dougpenny/PyJamPro/issues/new) explaining the bug with as much detail as possible.
The Jamf Pro API provides access to a lot of information and, unfortunately, we don't have time to research and implement every endpoint. Please feel free to open a pull request with any additional endpoints you create. We would love to have as many of the core endpoints covered as possible.
## License
PyJamPro is released under an MIT license. See [LICENSE](https://opensource.org/licenses/MIT) for more information.