To back up the database , you can export it as a .sql file. If you use a specific interface, find Export .
Then for the parser Python yaml.
DB_HOST :'localhost' DB_USER : 'root' DB_USER_PASSWORD:' P@ $$w0rd' DB_NAME : 'moodle_data' BACKUP_PATH : '/var/lib/mysql/moodle_data'
- thing key-value (sorry, did not find a better word for this). In a specific langage (e.g. PHP, I think), they are converted to objects. However, in python they are converted to dicts (the yaml parser does this, the JSON parser too).
# access an object attribute my_obj.attribute = 'something cool' my_obj.attribute
So, this is a very quick presentation of dicts, but you should start (run help(dict) and / or look here you will not regret it)
In your case:
config['DB_NAME']
source share