1.2 DESCRIBE parsing of common data formats to Python data structures Flashcards
A native Python library is included to import and parse XML data formats
xmltodict
Utilizes Python ordered dictionaries where the order of parent/child values matters
xmltodict
A method to work with native XML data formats in Python
import xmltodict
Python includes this native library to import and parse JSON data formats
json
A method to work with native JSON data formats in Python
import json
Import native JSON and convert the data to a Python dictionary
json.load()
Import native JSON data from a string to a Python dictionary
json.loads()
Write JSON data from Python objects to a file
json.dump()
Convert JSON dictionary data to a serialized string for parsing in Python
json.dumps()
A non-native Python module must be installed and is required to import and parse YAML data in Python
pyyaml
A method to install the non-native library required to work with YAML data formats in Python
pip install pyyaml
A method to work with native YAML data formats in Python
import yaml
Converts YAML to Python objects
yaml.load()
Converts Python objects to YAML
yaml.dump()