Palo Alto Networks SDK for Python to interact with PanOS devices via XML API. Version 1.12.5, active development with regular bugfix releases. Supports Python >=2.7 but not 3.0-3.4.
pip install pan-os-pythonVerified import paths — ran on the pinned version, not inferred.
Connect to a Palo Alto Networks firewall and list security rules.
Use 'from_' (with underscore) as the attribute name in Python, e.g., rule.from_
Replace PanDevice(hostname, api_username, api_password) with Firewall(hostname, api_username, api_password) or Panorama(...).
After adding an object to a device, call .create() on it or use .refreshall() to retrieve existing configurations.
Use fw.commit(sync=True) to block until the commit finishes, or handle job polling manually with commit() and waitfor()