Configuration
Stores GDAL configuration options for the current process. |
|
Returns the content of a config.ini file as a dictionary. |
|
get all allowed configuration keys for a section |
|
Initialize a configuration file. |
|
Reads a configuration file and returns a ConfigParser object |
|
Write configuration options to a config file. |
- s1ard.config.get_config(config_file=None, **kwargs)[source]
Returns the content of a config.ini file as a dictionary.
- Parameters:
- Return type:
- Returns:
Dictionary of the parsed config parameters. The keys correspond to the config sections in lowercase letters.
- s1ard.config.init(target, source=None, overwrite=False, **kwargs)[source]
Initialize a configuration file.
- Parameters:
target (
str) – Path to the target configuration file.source (
str|None) – Path to the source file to read the configuration from. If not provided, a default configuration file within the package will be used.overwrite (
bool) – Overwrite an existing file?kwargs – Additional keyword arguments for overwriting the configuration in source.
- Return type:
Examples
Create a file in the current working directory. work_dir and a scene search option (in this case SQLite via db_file) must be defined, other configuration is read from the default configuration file.
>>> from s1ard.config import init >>> init(target='config.ini', work_dir='.', db_file='scenes.db')
- s1ard.config.read_config_file(config_file=None)[source]
Reads a configuration file and returns a ConfigParser object
- Parameters:
config_file (str or None) – the configuration file name. If None, the default configuration file within the package will be used.
- Return type:
- Returns:
the configuration object
- s1ard.config.write(config, target, overwrite=False, **kwargs)[source]
Write configuration options to a config file.
- Parameters:
config (dict) – the configuration as returned by
get_config()target (str) – the name of the output file
overwrite (bool) – overwrite an existing file if it exists?
kwargs – further keyword arguments overriding configuration found in config.