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
Copy file name to clipboardExpand all lines: CHANGELOG.md
+20-1Lines changed: 20 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,9 +4,15 @@ All notable changes to this project will be documented in this file.
4
4
5
5
## [Unreleased]
6
6
7
+
8
+
## [0.9.1] - 2023-08-06
9
+
7
10
### Added
8
11
9
12
- Allow to pass a `ignore_missing_paths` parameter to each config method
13
+
- Support for Hashicorp Vault credentials (in `config.contrib`)
14
+
- Added a `validate` method to validate `Configuration` instances against a [json schema](https://json-schema.org/understanding-json-schema/basics.html#basics).
15
+
10
16
11
17
## [0.9.0] - 2023-08-04
12
18
@@ -31,12 +37,14 @@ All notable changes to this project will be documented in this file.
31
37
32
38
- Configurations from ini file won't be converted to lower case if `lowercase_keys = False`
33
39
40
+
34
41
## [0.8.2] - 2021-01-30
35
42
36
43
### Fixed
37
44
38
45
- The behavior of merging sets was incorrect since version 0.8.0
39
46
47
+
40
48
## [0.8.0] - 2020-08-01
41
49
42
50
### Changed
@@ -60,24 +68,28 @@ with cfg.dotted_iter():
60
68
- Support for _.env_-type files
61
69
- Option for deep interpolation. To activate that mode, use one of the enum values in `InterpolateEnumType` as the `interpolate_type` parameter. This allows for hierachical _templates_, in which configuration objects use the values from lower ones to interpolate instead of simply overriding.
62
70
71
+
63
72
## [0.7.1] - 2020-07-05
64
73
65
74
### Fixed
66
75
67
76
- Installation with `poetry` because of changes to pytest-black
68
77
78
+
69
79
## [0.7.0] - 2020-05-06
70
80
71
81
### Added
72
82
73
83
- New string interpolation feature
74
84
85
+
75
86
## [0.6.1] - 2020-04-24
76
87
77
88
### Changed
78
89
79
90
- Added a `separator` argument to `config` function
80
91
92
+
81
93
## [0.6.0] - 2020-01-22
82
94
83
95
### Added
@@ -86,6 +98,7 @@ with cfg.dotted_iter():
86
98
- Added a `reload` method to refresh a `Configuration` instance (can be used to reload a configuration from a file that may have changed).
87
99
- Added a `configs` method to expose the underlying instances of a `ConfigurationSet`
88
100
101
+
89
102
## [0.5.0] - 2020-01-08
90
103
91
104
### Added
@@ -98,13 +111,15 @@ with cfg.dotted_iter():
98
111
99
112
- Changed the `__repr__` and `__str__` methods so possibly sensitive values are not printed by default.
100
113
114
+
101
115
## [0.4.0] - 2019-10-11
102
116
103
117
### Added
104
118
105
119
- Allow path-based failures using the `config` function.
106
120
- Added a levels option to the dict-like objects.
107
121
122
+
108
123
## [0.3.1] - 2019-08-20
109
124
110
125
### Added
@@ -113,26 +128,30 @@ with cfg.dotted_iter():
113
128
- TravisCI support
114
129
- Codecov
115
130
131
+
116
132
## [0.3.0] - 2019-08-16
117
133
118
134
### Changed
119
135
120
136
- Changed the old behavior in which every key was converted to lower case.
121
137
138
+
122
139
## [0.2.0] - 2019-07-16
123
140
124
141
### Added
125
142
126
143
- Added Sphinx documentation
127
144
- Added a `remove_levels` parameter to the config function
Copy file name to clipboardExpand all lines: README.md
+59-1Lines changed: 59 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,6 +26,7 @@ and optionally
26
26
* Azure Key Vault credentials
27
27
* AWS Secrets Manager credentials
28
28
* GCP Secret Manager credentials
29
+
* Hashicorp Vault credentials
29
30
30
31
## Installing
31
32
@@ -276,13 +277,62 @@ When setting the `interpolate` parameter in any `Configuration` instance, the li
276
277
cfg = config_from_dict({
277
278
"percentage": "{val:.3%}",
278
279
"with_sign": "{val:+f}",
279
-
"val": 1.23456}, interpolate=True)
280
+
"val": 1.23456,
281
+
}, interpolate=True)
280
282
281
283
assert cfg.val ==1.23456
282
284
assert cfg.with_sign =="+1.234560"
283
285
assert cfg.percentage =="123.456%"
284
286
```
285
287
288
+
###### Validation
289
+
290
+
Validation relies on the [jsonchema](https://github.com/python-jsonschema/jsonschema) library, which is automatically installed using the extra `validation`. To use it, call the `validate` method on any `Configuration` instance in a manner similar to what is described on the `jsonschema` library:
# pass the `raise_on_error` parameter to get the traceback of validation failures
308
+
cfg.validate(schema, raise_on_error=True)
309
+
# ValidationError: 'Invalid' is not of type 'number'
310
+
```
311
+
312
+
To use the [format](https://python-jsonschema.readthedocs.io/en/latest/validate/#validating-formats) feature of the `jsonschema` library, the extra dependencies must be installed separately as explained in the documentation of `jsonschema`.
The `config.contrib` package contains extra implementations of the `Configuration` class used for special cases. Currently the following are implemented:
@@ -311,6 +361,14 @@ The `config.contrib` package contains extra implementations of the `Configuratio
311
361
pip install python-configuration[gcp]
312
362
```
313
363
364
+
*`HashicorpVaultConfiguration` in `config.contrib.vault`, which takes Hashicorp Vault
365
+
credentials into a `Configuration`-compatible instance. To install the needed dependencies
0 commit comments