From e7ba441a05309fe63c7bb9db07272a215c539665 Mon Sep 17 00:00:00 2001 From: 7000pctAUTO Date: Sat, 31 Jan 2026 07:10:11 +0000 Subject: [PATCH] Initial upload: ConfDoc v0.1.0 - Config validation and documentation generator --- src/confdoc/parsers/json_parser.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/confdoc/parsers/json_parser.py diff --git a/src/confdoc/parsers/json_parser.py b/src/confdoc/parsers/json_parser.py new file mode 100644 index 0000000..7d13c41 --- /dev/null +++ b/src/confdoc/parsers/json_parser.py @@ -0,0 +1,18 @@ +import json +from typing import Any, Dict + + +class JsonParser: + """Parser for JSON configuration files.""" + + def parse(self, content: str) -> Dict[str, Any]: + """Parse JSON content into a dictionary.""" + return json.loads(content) + + def dump(self, data: Dict[str, Any]) -> str: + """Dump dictionary to JSON string.""" + return json.dumps(data, indent=2) + + def get_format(self) -> str: + """Return the format name.""" + return "json"