You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implementation of key-value pair based configuration for Python applications.
@@ -11,7 +15,7 @@ Implementation of key-value pair based configuration for Python applications.
11
15
12
16
This library is freely inspired by .NET Core `Microsoft.Extensions.Configuration` namespace and its pleasant design (_ref. [MSDN documentation](https://docs.microsoft.com/en-us/aspnet/core/fundamentals/configuration/?view=aspnetcore-2.1), [Microsoft Extensions Configuration Deep Dive](https://www.paraesthesia.com/archive/2018/06/20/microsoft-extensions-configuration-deep-dive/)_).
13
17
14
-
The main class is influenced by Luciano Ramalho's example of
18
+
The main class is influenced by Luciano Ramalho`s example of
15
19
JSON structure explorer using attribute notation, in his book [Fluent Python](http://shop.oreilly.com/product/0636920032519.do).
16
20
17
21
## Supported sources:
@@ -30,31 +34,36 @@ pip install roconfiguration
30
34
# Examples
31
35
32
36
### YAML file and environmental variables
33
-
In this example, configuration will be comprised of anything inside a file `settings.yaml` and environmental variables. Settings are applied in order, so environmental variables with matching name override values from the `yaml` file.
37
+
In this example, configuration will be comprised of anything inside a file
38
+
`settings.yaml` and environmental variables. Settings are applied in order, so
39
+
environmental variables with matching name override values from the `yaml`
40
+
file.
34
41
35
42
36
43
```python
37
44
from roconfiguration import Configuration
38
45
39
46
config = Configuration()
40
47
41
-
config.add_yaml_file('settings.yaml')
48
+
config.add_yaml_file("settings.yaml")
42
49
43
50
config.add_environmental_variables()
44
51
```
45
52
46
53
### YAML file, optional file by environment
47
-
In this example, if an environmental variable with name `APP_ENVIRONMENT` and value `dev` exists, and a configuration file with name `settings.dev.yaml` is present, it is read to override values configured in `settings.yaml` file.
54
+
In this example, if an environmental variable with name `APP_ENVIRONMENT` and
55
+
value `dev` exists, and a configuration file with name `settings.dev.yaml` is
56
+
present, it is read to override values configured in `settings.yaml` file.
0 commit comments