There is a yaml file which is having wrong indentation like below:
name: testing
date: 2020-07-13
version: 1.0
targets:
- sequence: 1
name: Book1
author: abc
- sequence: 2
name: Book2
author: xyz
which If I try to load it using pyYAML will get parser exception like :
yaml.parser.ParserError: while parsing a block collection
in "E:/test.yaml", line 5, column 3
expected <block end>, but found '<block mapping start>'
in "E:/test.yaml", line 6, column 4
How to convert this yaml with indentation problem to dict without manually fixing indentation? or convert to dict no matter how yaml is indented?