Extreme API with Python
Table Of Contents
- 1 Preface
- 2 Introduction
- 3 EXOS APIs
- 4 VOSS API
- 5 XMC API
- 6 ExtremeCloud IQ API
- 7 Extreme Campus Controller API
Extreme API with Python
Page | 17
Part no.9036931-00 Rev AA February 2021
import json
json_sample = '''
{
"whisky": [
{
"name": "Hibiki",
"type": "Blended",
"age": 17
},
{
"name": "Old Pulteney",
"type": "Single Malt",
"age": 21
}
],
"stock": null,
"alcohol": true
}
'''
data = json.loads(json_sample)
print(type(data))
print(data)
new_data = json.dumps(data)
print(type(new_data))
print(new_data)
This example imports the JSON module and manipulates a JSON entry in Python. You must first
transform it to an editable dictionary, then reconvert it to JSON format. The null and Boolean values
change accordingly.
<class 'dict'>
{'whisky': [{'name': 'Hibiki', 'type': 'Blended', 'age': 17}, {'name': 'Old
Pulteney', 'type': 'Single Malt', 'age': 21}], 'stock': None, 'alcohol':
True}
<class 'str'>










