Day 15 Task: Python Libraries for DevOps

Day 15 Task: Python Libraries for DevOps

ยท

2 min read

๐Ÿ”ถ Reading JSON and YAML in Python

  • As a DevOps Engineer, you should be able to parse files, be it txt, json, yaml, etc.

  • You should know what libraries one should use in Python for DevOps.

  • Python has numerous libraries like os, sys, json, yaml etc that a DevOps Engineer uses in day-to-day tasks.

๐Ÿ”ถ Tasks-1: Create a Dictionary in Python and write it to a JSON File.

json.dump() - convert a Python object into an equivalent JSON object and store the result into a JSON file in the working directory.

๐Ÿ”ถ Tasks-2: Read a JSON file services.json kept in this folder and print the service names of every cloud service provider.

output
aws : ec2
azure : VM
gcp : compute engine

json.loads()- It is used to parse a valid JSON string and convert it into a Python Dictionary.

๐Ÿ”ถ Tasks-3: Read the YAML file using Python, file services.yaml and read the contents to convert yaml to json

Stay in the loop with my latest insights and articles on cloud โ˜๏ธ and DevOps โ™พ๏ธ by following me on Hashnode, LinkedIn (https://www.linkedin.com/in/chandreshpatle28/), and GitHub (https://github.com/Chandreshpatle28).

GitHub Repo for the above task :Chandreshpatle28/python_practice.git

Thank you for reading! Your support means the world to me. Let's keep learning, growing, and making a positive impact in the tech world together.

#Git #Linux Devops #Devopscommunity #90daysofdevopschallenge #python

Did you find this article valuable?

Support Chandresh Patle's Blog by becoming a sponsor. Any amount is appreciated!

ย