How to store Settings in txt-file?
To set settings:
import bpy
import json

my_txt = '''
{
    &quot;render&quot;: {
        &quot;engine&quot;: &quot;BLENDER_EEVEE&quot;
    },
    &quot;eevee&quot;: {
        &quot;taa_render_samples&quot;: 45,
        &quot;use_motion_blur&quot;: false
    }
}
'''

render_settings = json.loads(my_txt)

for section in render_settings.keys():
    for name, value in render_settings[section].items():
        setattr(getattr(bpy.context.scene, section), name, value)

To get primitive settings:
import bpy
import inspect

primitive_types = {int, str, float, bool}

section = bpy.context.scene.render

def is_valid(i):
    if i[0].startswith('_'):
        return False
    if not type(i[1]) in primitive_types:
        return False
    if section.is_property_readonly(i[0]):
        return False
    return True

settings = inspect.getmembers(section, lambda i: not(inspect.isroutine(i)))
settings = dict([i for i in settings if is_valid(i)])

for name, value in settings.items():
    print(name, value)