Skip to content

Commit 6c69f46

Browse files
validation bis
1 parent 5f46a89 commit 6c69f46

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

energyml-utils/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,12 @@ energyml-prodml2-2 = "^1.12.0"
8585
- xml_to_json : translate an energyml xml file into json.
8686
- json_to_xml : translate an energyml json file into an xml file
8787
- describe_as_csv : create a csv description of an EPC content
88+
- validate : validate an energyml object or an EPC instance (or a folder containing energyml objects)
89+
90+
91+
92+
## Validation example :
93+
94+
```bash
95+
poetry run validate --input "path/to/your/energyml/object.xml" *> output_logs.json
96+
```

energyml-utils/example/tools.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -614,8 +614,9 @@ def validate_files():
614614
epc = Epc()
615615
epc.energyml_objects = objects
616616

617-
for err in validate_epc(epc):
618-
print(err.toJson())
617+
err_json = [err.toJson() for err in validate_epc(epc)]
618+
619+
print(json.dumps(err_json, indent=4))
619620

620621

621622
# def export_wavefront():

0 commit comments

Comments
 (0)