Tools for working with PAN-OS Skillets in Python 3
Project description
Skilletlib
Base Classes and Utilities for working with Skillets. Skilletlib encapsulates all the logic necessary to execute a skillet in your app or tooling.
Basic Example
from skilletlib import SkilletLoader
# init SkilletLoader Class
sl = SkilletLoader()
# Load all skillets from the current directory
skillets = sl.load_all_skillets_from_dir('.')
# get the first skillet found
skillet = skillets[0]
# Every skillet requires a context, which is a dict containing
# any user-input or other variables
context = dict()
# In this example, our skillet needs a configuration.xml file to be loaded into a variable
# called 'config'
with open('config.xml', 'r') as config:
context['config'] = config.read()
# execute the skillet and return the results
out = skillet.execute(context)
# Do something interesting with the results, like print it out :-)
print(out)
print('all done')
Loading Skillets from a Git repository
from skilletlib import SkilletLoader
repo_url = 'https://github.com/nembery/Skillets'
repo_branch = 'develop'
directory = '/var/tmp/skillets'
repo_name = 'example skillets'
sl = SkilletLoader()
skillets = sl.load_from_git(repo_url, repo_name, repo_branch, local_dir=directory)
for s in skillets:
print(s.name)
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
skilletlib-0.1.2.6.tar.gz
(43.2 kB
view hashes)
Built Distribution
Close
Hashes for skilletlib-0.1.2.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ef4a150b1cf100dc465719cace7abcc6fa7a6acb3e54ce449a0ee84213656e4 |
|
MD5 | 287295a0f6fcf53a5637ee0d07b98edf |
|
BLAKE2b-256 | 028f8e31825b76e090210792a1a87d694fdc211e737a26959ba124ffd8300071 |