Skip to content

Commit a00e55b

Browse files
author
BrunoSilvaAndrade
committed
Updating README.md
1 parent 717631c commit a00e55b

1 file changed

Lines changed: 15 additions & 29 deletions

File tree

README.md

Lines changed: 15 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,17 @@
1-
# python-json-config-parser
2-
This project was created to give you the possibility of creating json config files dynamicaly using OOP
1+
# python-config-parser
2+
This project was created to give you the possibility of creating json and yaml/yml config files dynamically using OOP
33

44
HOW TO INSTALL
55
---------------------------
66
Use pip to install it.
77

88
```
9-
pip install python-json-config-parser
9+
pip install python-config-parser
1010
```
1111

1212

1313
HOW TO USE
1414
---------------------------
15-
The Class Config takes two arguments, the first is a Schema(https://github.com/keleshev/schema) to ensure the model of config, the second is the str path of json config file.
16-
17-
If you don't specify the path, the default value('config.json') will be used if one exists in the same dir where the script is running.
18-
19-
For example:
2015

2116
The model file.
2217
```
@@ -39,29 +34,20 @@ SCHEMA_CONFIG = {
3934
4035
```
4136

42-
The config.json file
37+
The config.yml file
4338
```
44-
{
45-
"core":{
46-
"logging":{
47-
"format":"[%(asctime)s][%(levelname)s]: %(message)s",
48-
"datefmt": "%d-%b-%y %H:%M:%S"
49-
},
50-
"allowed_clients":[
51-
{
52-
"ip":"192.168.0.10",
53-
"timeout":60
54-
},
55-
{
56-
"ip":"192.168.0.11",
57-
"timeout":100
58-
}
59-
]
60-
}
61-
}
39+
core:
40+
logging:
41+
format: "[%(asctime)s][%(levelname)s]: %(message)s"
42+
datefmt: "%d-%b-%y %H:%M:%S"
43+
allowed_clients:
44+
- ip: 192.168.0.10
45+
timeout: 60
46+
- ip: 192.168.0.11
47+
timeout: 100
6248
```
6349

64-
The istance of Config Class:
50+
The instance of Config Class:
6551
```
6652
from jsonconfigparser import Config, ConfigException
6753
import logging
@@ -83,7 +69,7 @@ logging.getLogger(__name__)
8369
logging.basicConfig(
8470
format=fmt,
8571
datefmt=dtfmt
86-
level=20
72+
level=logging.INFO
8773
)
8874
8975
#the list of object example:

0 commit comments

Comments
 (0)