dicogis.utils.db_conf_reader module¶
Simple function to load database configuration files (= ini structure).
- dicogis.utils.db_conf_reader.read_db_conf(dbconf_path)¶
Read databases configuration files and return parameters as list of dictionaries.
- Parameters:
dbconf_path (Path) – filepath to *.dbconf file
- Raises:
TypeError – if input filepath is not an instance of pathlib.Path
FileExistsError – if input file is not reachable
- Returns:
list of dictionary/ies with database parameters
- Return type:
- Example:
# here comes an example in Python pprint(read_db_conf("./sample.dbconf")) { "name": "database_name", "host": "database_server_url", "port": "5432", "username": "db_user_name", "password": "db_user_password", "schemas": "db_schemas", "esri_sde": False }