Skip to main content

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


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)

Uploaded Source

Built Distribution

skilletlib-0.1.2.6-py3-none-any.whl (70.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page