@@ -13,22 +13,22 @@ from naminter import WMNFormatter
1313with open (" wmn-data.json" , encoding = " utf-8" ) as f:
1414 data = json.load(f)
1515
16- with open (" wmn-schema.json" , encoding = " utf-8" ) as f:
16+ with open (" wmn-data- schema.json" , encoding = " utf-8" ) as f:
1717 schema = json.load(f)
1818
19- # Read original content for comparison
19+ # Read original data for comparison
2020input_path = Path(" wmn-data.json" )
21- original_content = input_path.read_text(encoding = " utf-8" )
21+ original_data = input_path.read_text(encoding = " utf-8" )
2222
2323# Create formatter with schema
2424formatter = WMNFormatter(schema)
2525# Format data (data is not modified)
26- formatted_content = formatter.format_dataset (data)
26+ formatted_data = formatter.format_data (data)
2727
2828# Compare and write if changed
29- if original_content != formatted_content :
29+ if original_data != formatted_data :
3030 output_path = Path(" wmn-data-formatted.json" )
31- output_path.write_text(formatted_content , encoding = " utf-8" )
31+ output_path.write_text(formatted_data , encoding = " utf-8" )
3232 print (" File was formatted and saved" )
3333else :
3434 print (" File was already properly formatted" )
@@ -40,9 +40,9 @@ The formatter is also available via the CLI:
4040
4141``` bash
4242naminter format \
43- --local-schema schema.json \
44- --local-data data.json \
45- --output formatted-data.json
43+ --local-schema wmn-data- schema.json \
44+ --local-data wmn- data.json \
45+ --output-data formatted-data.json
4646```
4747
4848## API Reference
0 commit comments