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