I have a file called clients.conf .
Here is its content :
client: {
# client data
name: "James"
information: {
age: "32"
adress: "258 Arthur Street"
}
email: jamesbryan@yyyy.com
certification: {
status: "expired"
id: 12345324
}
}
I would like to parse it using python 2.7 (or 3.x). Here is the code I am using, it doesn't detect any section in the file:
config = ConfigParser()
with open('clients.conf') as stream:
stream = StringIO(stream.read())
config.readfp(stream)
print(config.sections())
The print.sections() at the end provides an empty array.