-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py
44 lines (33 loc) · 1.23 KB
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Configuration File for Skilpad Automatic Data Analysis
Project Name: Skilpad Automatic Data Analysis
Author: Antonio Fin
Email: [email protected]
Date: 2023/08/06
Version: Prototype
Description:
This configuration file manages the settings for the Skilpad Automatic Data Analysis project.
It uses the ConfigParser library to read and write configuration settings, ensuring
modularity and ease of changes in the project setup.
Usage:
Import this module into the main project file or any other module that requires access
to the configuration settings.
Example:
from config import load_settings
settings = load_settings()
data_directory = settings.get('Paths', 'data_directory')
"""
import configparser
def load_settings(config_file='settings.ini'):
"""Load the project settings from the configuration file."""
config = configparser.ConfigParser()
config.read(config_file)
return config
if __name__ == "__main__":
# For testing or initialization purposes, if required.
settings = load_settings()
for section in settings.sections():
for key, value in settings.items(section):
print(f"{section}.{key} = {value}")