Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?


Overview of Python Modules on Devices Running Junos OS

The Python interpreter is included as part of the Junos operating system (Junos OS). Devices running Junos OS include many Python modules that can be used in Python applications including commit, event, op, and SNMP automation scripts; Juniper Extension Toolkit (JET) applications; and YANG action and translation scripts. Usage of a specific module depends on the permissions of the user who is executing it.

Table 1 outlines the general updates and affected platforms for each set of modules upgrades in a specific Junos OS version.

Table 1: Python Module Upgrades


Description of Changes

Supported Platforms

Junos OS Release 18.1R1

Module upgrades for Python 2.7

MX240, MX480, MX960, and vMX routers

Junos OS Release 19.2R1

Module upgrades for Python 2.7

MX Series routers and QFX Series switches

Junos OS Release 19.4R1

Module upgrades for Python 2.7

Module additions for Python 3.x (commit, event, op, and SNMP scripts only)

ACX Series, MX Series, and PTX Series routers

EX Series and QFX Series switches

SRX Series Services Gateways

Juunos OS Release 20.2R1

Module additions for Python 3.x

ACX Series, MX Series, and PTX Series routers

EX Series and QFX Series switches

SRX Series Services Gateways

Table 2 outlines the Python modules that are available on devices running Junos OS. The Python 3 installation includes the same set of modules, except where noted.

Table 2: Python Modules Available on Devices Running Junos OS




Determines the path to the appropriate platform-specific directories for application-specific user data.


Library for parsing and serializing Abstract Syntax Notation One (ASN.1) structures.


C Foreign Function Interface for Python, which enables Python applications to interact with C code.


Universal character encoding detector for Python 2 and 3.


Collection of Python modules in the PyCrypto package that implement cryptographic algorithms and protocols. The modules provide various secure hash and encryption functions.


Provides cryptographic recipes and primitives in Python.


Provides an interface for asynchronously executing callables.

Python 3 includes this package as part of the standard library.


Provides an implementation of ECDSA cryptography, which can be used to create key pairs, sign messages, and verify signatures.


enum34 package, which provides support for enumerations.

Python 3 includes this functionality as part of the standard library.


Provides support for working with protocol buffers (protobuf).


Python gRPC tools.


Provides support for the Internationalized Domain Names in Applications (IDNA) protocol, as defined in RFC 5891, Internationalized Domain Names in Applications (IDNA): Protocol.


Provides capabilities to create, manipulate, and operate on IPv4 and IPv6 addresses.

Python 3 includes this module as part of the standard library.


Devices running Junos OS with upgraded FreeBSD support using IPv6 in Python scripts starting in Junos OS Release 19.3R1.


Fast, secure, designer-friendly templating language for Python.

For more information about Jinja2, see


(Junos PyEZ or junos-eznc)

Microframework for Python that enables you to automate devices running Junos OS. Junos PyEZ is designed to provide the capabilities that a user would have on the Junos OS command-line interface (CLI) in an environment built for automation tasks.

For more information, see Junos PyEZ.


Python module for converting XML to Python data structures and converting Python data structures to XML.

For more information, see


XML processing library that combines the speed and XML feature completeness of the C libraries libxml2 and libxslt with the simplicity of a native Python API.

For more information about the lxml Python module, see


Provides the ability to escape and format an XML, HTML, or XHTML markup safe string.


Facilitates client scripting and application development through the NETCONF protocol.

For more information about ncclient, including documentation for the external APIs, see


Network address manipulation library that enables processing of Layer 2 and Layer 3 network addresses.


Core utilities for Python packages.


Serves as a client class that enables applications to connect to a Message Queue Telemetry Transport (MQTT) broker to publish messages and to subscribe to topics and receive published messages.


SSH2 protocol library that provides the ability to make SSH2 protocol-based connections. This module supports all major ciphers and hash methods for both client and server modes.


paramiko version 2.1.2 is only supported on devices running Junos OS with upgraded FreeBSD.


Provides APIs for finding and managing Python package and version dependencies and accessing bundled files and resources.


Library for retrieving information on running processes and system utilization (CPU, memory, disks, and processes).


psutil is only supported on devices running Junos OS with upgraded FreeBSD, and only a subset of functions is supported. For more information, see Using the psutil Module to Retrieve Process and System Information on Devices Running Junos OS


Extensible YANG validator and converter that enables the processing, validation, and conversion of YANG modules.

Junos OS adds support for pyang in Python 3 and removes support for pyang in Python 2.7 starting in Junos OS Release 20.2R1.


Python implementation of Abstract Syntax Notation One (ASN.1) types and BER/CER/DER codecs (X.208).


Parser for the C language written in pure Python. The module can be integrated into applications that need to parse C source code.


Provides an alternative approach to creating and executing simple grammars.


Library that enables sending HTTP/1.1 requests using Python.


Implementation of the SCP protocol for Paramiko that uses Paramiko transport to send and receive files via the SCP protocol.


Module in the pySerial package that encapsulates the access for serial ports.


Python 2 and Python 3 compatibility library.


Provides Python bindings for the Apache Thrift framework.

thrift is only supported for Python 2.7 and only on devices running Junos OS Release 19.3 and earlier.


HTTP client for Python.


Module in the PyYAML package that is used to serialize and deserialize data in YAML format.