I'm trying to convert the following piece of data into a dict so I can have key:value pair and have them nested :

```
data="Group A\n name : rey\n age : 6\n status : active\n in role : 201\n weight : 25\n interests\n Out Side : 16016\n In Side : 0\n Out : 2804\n\n name : dan\n age : 5\n status : inactive\n in role : 201\n weight : 18\n interests\n Out Side : 16016\n In Side : 0\n Out : 2804\n\n"

```

Problem is, not all of them have `:` and some of them are supposed to be grouped together (i.e part of `Group A`). `\n` line break definitely helps me in separating them.

Here's the result I'm hoping to get :

```
[
 {
  "Group A":
   [
    {"name": "rey", "age": "6", "status": "active"},
    {"name": "dan", "age": "5", "status": "inactive"}
   ]
 }
]

```

What do I have right now? I've separated some of them into `dict` with :

```
result = {}
for row in data.split('\n'):
  if ':' in row:
    key, value = row.split(':')
    result[key] = value.strip()

```

This outputs me :

`{' name ': 'dan', ' weight ': '18', ' In Side ': '0', ' Out ': '2804', ' in role ': '201', ' status ': 'inactive', ' Out Side ': '16016', ' age ': '5'}`
But this messes up with the existing order in which the data is shown above - and not all of it came out.

I'm kind of capturing this data from an external program and so limited to only Python version 2.7. Any ideas would be super helpful!