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
# default.config.yaml - this file usually goes to version control system
@@ -80,6 +81,7 @@ from pyya import init_config
80
81
config = init_config(
81
82
'config.yaml', 'default.config.yaml',
82
83
convert_keys_to_snake_case = False,
84
+
add_underscore_prefix_to_keywords = False
83
85
raise_error_non_identifiers = False)
84
86
print(json.dumps(config.database))
85
87
@@ -92,9 +94,24 @@ As you can see, `pyya` automatically merges default config file with production
92
94
93
95
Under the hood `pyya` uses [PyYAML](https://pypi.org/project/PyYAML/) to parse YAML files and [munch](https://pypi.org/project/munch/) library to create attribute-stylish dictionaries.
94
96
95
-
`pyya` automatically adds underscore prefix to Python keywords and can be configured to convert `camelCase` or `PascalCase` keys to `snake_case`.
97
+
and can be configured to .
98
+
99
+
### Flags
96
100
97
-
If `raise_error_non_identifiers=True`, `pyya` will raise error if section name is not valid Python identifier.
101
+
```python
102
+
convert_keys_to_snake_case=True
103
+
# `pyya` converts `camelCase` or `PascalCase` keys to `snake_case`
104
+
```
105
+
106
+
```python
107
+
add_underscore_prefix_to_keywords=True
108
+
# `pyya` adds underscore prefix to keys that are Python keywords
109
+
```
110
+
111
+
```python
112
+
raise_error_non_identifiers=True
113
+
# `pyya` raises error if key name is not valid Python identifier
0 commit comments