You could use pyYAML to parse yaml files in python (pip install pyyaml).
pyYAML
yaml
pip install pyyaml
Then, in your code:
import yaml with open('yourfile.yml') as f: self.category_sector_mapping = yaml.safe_load(f)