DevNet Associate DEVASC 200-901 Official Certification Guide by Adrian Iliesiu (z-lib.org)

(andrew) #1
import time

Modules for working with data:


xmltodict: This module translates XML-formatted files into
native Python dictionaries (key/value pairs) and back to XML, if
needed. Use the following command to install this module:

pip install xmltodict

Use the following command to import this module:

import xmltodict

csv: This is a standard library module for understanding CSV files.
It is useful for exporting Excel spreadsheets into a format that you
can then import into Python as a data source. It can, for example,
read in a CSV file and use it as a Python list data type. Use the
following command to import this module:

import csv

json: This is a standard library module for reading JSON-
formatted data sources and easily converting them to dictionaries.
Use the following command to import this module:

import json

PyYAML: This module converts YAML files to Python objects that
can be converted to Python dictionaries or lists. Use the following
command to install this module:

pip install PyYAML

Use the following command to import this module:

import yaml

pyang: This isn’t a typical module you import into a Python
program. It’s a utility written in Python that you can use to verify
your YANG models, create YANG code, and transform YANG
Free download pdf