Install Jook
You can install Jook from the Pyhon Package Index:
$ pip install jook
Basic Usage
Jook allows you to create Python objects that can fire off HTTP requests that mock webhook events from a Jamf Pro server.
Getting started is easy:
>>> import jook
>>> computer = jook.Computer('http://localhost', 'ComputerAdded')
>>> computer.fire()
Jook supports both JSON and XML formats for data to send (JSON is the default):
>>> computer = jook.Computer('http://localhost', 'ComputerCheckIn', mode='xml')
>>> computer.to_xml()
'<?xml version="1.0" encoding="UTF-8" ?><JSSEvent><webhook><webhookEvent>ComputerCheckIn</webhookEvent>...</JSSEvent>'
>>> computer.to_json()
'{"webhook": {"webhookEvent": "ComputerCheckIn", "id": 1, "name": ""}, "event": {...}'
Create objects in randomize mode to generate unique data with every fire:
>>> rand_comp = jook.Computer('http://localhost', 'ComputerInventoryCompleted', randomize=True)
>>> rand_comp.data
{'webhook': {...}, 'event': {..., 'udid': '0699A579-2835-4E5F-8847-944D9A477DDD', 'serialNumber': 'CPFQ2MXCG5ND', ...}}
>>> rand_comp.data
{'webhook': {...}, 'event': {..., 'udid': '1ABE2310-4396-4ABC-AAA9-5B48E6CFC7F5', 'serialNumber': 'C1FK9EXSFKQT', ...}}
Create DeviceData and LocationData objects to pass into webhooks to control the data sent in the mock events:
>>> my_device = DeviceData('computer')
>>> my_device.serial_number
'CPFQMEE3HYFH'
>>> comp1 = Computer('http://localhost', 'ComputerAdded', device=my_device)
>>> comp1.device.serial_number
'CPFQMEE3HYFH'
>>> comp2 = Computer('http://localhost', 'ComputerCheckIn', device=my_device)
>>> comp1.device.serial_number
'CPFQMEE3HYFH'
Set events to run in a loop with a set delay. This example sets a timer delay of five seconds and then starts a loop of 10 fire calls:
>>> computer = jook.Computer('http://localhost', 'ComputerCheckIn', timer=5)
>>> computer.start_timer(repeat=10)
Metadata
Release files for jook 0.4.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| jook-0.4.3.tar.gz | 8.6 kB | Without provenance | Details for jook-0.4.3.tar.gz |
Release files / jook-0.4.3.tar.gz
| Download URL | jook-0.4.3.tar.gz |
|---|---|
| Size | 8.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
522bebcd8059d1af7d199ed078067586bf621bda2b316b12a63324aea1bbd087
|
|
BLAKE2b-256 checksum How to use checksums |
8f20c6268871f289ed1aeac241864ad469a599b7239e7aa0b2450c631ecd2d27
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for jook 0.4.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.