Skip to content

Commit 9a470e8

Browse files
committed
Add python sample code
Signed-off-by: costimuraru <[email protected]>
1 parent f87bf4e commit 9a470e8

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,19 @@ examples/config_example
7272
│   └── cluster.yaml
7373
└── region.yaml
7474
```
75+
76+
### Using the python module
77+
78+
```py
79+
from hierarchical_yaml import ConfigProcessor
80+
81+
config_processor = ConfigProcessor()
82+
path = "examples/config_example/env=dev/region=us-east-1/cluster=cluster2"
83+
filters = () # can choose to output only specific keys
84+
exclude_keys = () # can choose to remove specific keys
85+
output_format = "yaml" # yaml/json
86+
87+
88+
config_processor.process(path=path, filters=filters, exclude_keys=exclude_keys,
89+
output_format=output_format, print_data=True)
90+
```

0 commit comments

Comments
 (0)