|
1 | | -# python-config-parser |
| 1 | +Python-config-parser |
| 2 | +=== |
2 | 3 | This project was created to give you the possibility |
3 | 4 | of creating runtime configuration objects using json or yaml files. |
4 | 5 |
|
5 | 6 | MAIN FEATURES |
6 | | ---------------------------- |
| 7 | +=== |
| 8 | +--- |
7 | 9 | * Declarative configurations without using .ini files |
8 | 10 | * Access OOP or subscriptable, which means that you can iterate the config object items |
9 | 11 | * Runtime validation using [schema](https://github.com/keleshev/schema) |
10 | 12 | * Automatic environment variables interpolation |
11 | 13 | * Automatic parser selecting by config file extension |
12 | 14 |
|
13 | 15 | HOW TO INSTALL |
14 | | ---------------------------- |
| 16 | +=== |
| 17 | +--- |
15 | 18 | Use pip to install it. |
16 | 19 |
|
17 | 20 | ```shell |
18 | 21 | pip install python-config-parser |
19 | 22 | ``` |
20 | 23 |
|
21 | 24 | HOW TO USE |
22 | | ---------------------------- |
23 | | - First of all the config file will look for default config files if you do not pass your own config file for this. |
| 25 | +=== |
| 26 | +--- |
| 27 | +First of all the config file will look for default config files if you do not pass your own config file for this. |
24 | 28 |
|
25 | | - The default config directory is ./config(if you do not pass the config directory of your preference) assuming your current directory. |
| 29 | +The default config directory is ./config(if you do not pass the config directory of your preference) assuming your current directory. |
26 | 30 |
|
27 | | - The default config files names are -> (config.json, config.yaml, config.yml) |
| 31 | +The default config files names are -> (config.json, config.yaml, config.yml) |
28 | 32 |
|
29 | 33 |
|
30 | 34 |
|
31 | 35 |
|
32 | 36 | The Schema validation. |
| 37 | +--- |
33 | 38 |
|
34 | | - You may use or not schema validation, if you want to use it, it will validate your whole config object before returning it. |
| 39 | +You may use or not schema validation, if you want to use it, it will validate your whole config object before returning it. |
35 | 40 |
|
36 | | - If you don't want to use it, it won't validate the config object before returning that, and it may generate runtime access inconsistencies. |
| 41 | +If you don't want to use it, it won't validate the config object before returning that, and it may generate runtime access inconsistencies. |
37 | 42 |
|
38 | | - How to use schema |
| 43 | +How to use schema |
39 | 44 |
|
40 | 45 | ```python |
41 | 46 | from schema import Use, And |
@@ -155,6 +160,7 @@ Config.set_hold_an_instance(False) |
155 | 160 |
|
156 | 161 |
|
157 | 162 | CONTRIBUTE |
158 | | ----------- |
| 163 | +--- |
| 164 | +--- |
159 | 165 |
|
160 | 166 | Fork https://github.com/BrunoSilvaAndrade/python-config-parser/ , create commit and pull request to ``develop``. |
0 commit comments