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 scripts. Usage of a specific module depends on the permissions of the user who is executing it.

Table 1 outlines the Python modules that are available on devices running Junos OS, provides a brief description of each module, and specifies the release in which each version of a module was first introduced for Junos OS and Junos OS with Enhanced Automation releases.

Note

New or upgraded versions of Python modules that were added in Junos OS Release 18.1R1 are only supported on MX240, MX480, MX960, and vMX routers.

New or upgraded versions of Python modules that were added in Junos OS Release 19.2R1 are only supported on MX Series routers and QFX Series switches.

Table 1: Python Modules Available on Devices Running Junos OS

Package/Module

Description

Module Version

First Supported Junos OS Releases

appdirs

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

1.4.3

18.1

asn1crypto

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

0.22.0

18.1

cffi

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

1.10.0

18.1

chardet

Universal character encoding detector for Python 2 and 3.

3.0.4

19.2

Crypto

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

2.6.1

14.1X53‑D10 (Enhanced Automation only)

16.1

cryptography

Provides cryptographic recipes and primitives in Python.

1.8.1

18.1

concurrent.futures

Provides an interface for asynchronously executing callables.

3.0.5

16.2

ecdsa

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

0.11

14.1X53‑D10 (Enhanced Automation only)

16.1

enum

enum34 package, which provides support for enumerations.

1.1.1

16.2

1.1.6

18.1

google.protobuf

Provides support for working with protocol buffers (protobuf).

3.0.0a3

16.2

grpc

Python gRPC tools.

0.11.0

16.2

1.0.0

17.2

idna

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

2.5

18.1

2.7

19.2

ipaddress

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

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

1.0.18

17.4

1.0.22

19.2

jinja2

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

For more information about Jinja2, see http://jinja.pocoo.org/docs/dev/.

2.7.2

14.1X53‑D10 (Enhanced Automation only)

16.1

2.9.6

17.4

jnpr.junos

(Junos PyEZ)

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.

1.3.1

16.1

2.1.4

17.4

jxmlease

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

For more information, see https://jxmlease.readthedocs.io/.

1.0.1

17.4

libffi

Portable, foreign-function interface library.

3.2.1

18.1

lxml

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 http://lxml.de.

3.2.5

14.1X53‑D10 (Enhanced Automation only)

16.1

3.7.3

17.4

markupsafe

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

0.18

14.1X53‑D10 (Enhanced Automation only)

16.1

1.0

17.4

ncclient

Facilitates client scripting and application development through the NETCONF protocol.

For more information about ncclient, including documentation for the external APIs, see http://ncclient.grnet.gr/.

0.4.1

14.1X53‑D10 (Enhanced Automation only)

0.4.6

16.1

0.5.3

17.4

netaddr

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

0.7.12

16.1

0.7.19

17.4

paho.mqtt

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.

1.0

16.1

packaging

Core utilities for Python packages.

16.8

18.1

paramiko

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.

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

1.12.1

14.1X53-D10 (Enhanced Automation only)

1.15.2

16.1

2.1.2

18.1

pkg_resources

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

20.0

16.2

psutil

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

Note: 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

5.2.2

18.1

pyang

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

1.5

16.1

pyasn1

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

0.2.3

18.1

pycparser

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

2.17

18.1

pyparsing

Provides an alternative approach to creating and executing simple grammars.

2.2.0

18.1

requests

Library that enables sending HTTP/1.1 requests using Python.

2.19.1

19.2

scp

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

0.8.0

16.1

0.10.2

17.4

serial

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

3.3

17.4

six

Python 2 and Python 3 compatibility library.

1.10.0

17.2

1.11.0

19.2

thrift

Provides Python bindings for the Apache Thrift framework.

0.9.2

16.1

urllib3

HTTP client for Python.

1.23

19.2

yaml

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

3.11

16.1

3.12

17.4