diff --git a/stubs/xmltodict/METADATA.toml b/stubs/xmltodict/METADATA.toml new file mode 100644 index 000000000000..050b0f8beee3 --- /dev/null +++ b/stubs/xmltodict/METADATA.toml @@ -0,0 +1 @@ +version = "0.12.*" diff --git a/stubs/xmltodict/xmltodict.pyi b/stubs/xmltodict/xmltodict.pyi new file mode 100644 index 000000000000..68ff491ffad6 --- /dev/null +++ b/stubs/xmltodict/xmltodict.pyi @@ -0,0 +1,33 @@ +from _typeshed import SupportsRead, SupportsWrite +from collections import OrderedDict +from typing import Any, Mapping, overload + +class ParsingInterrupted(Exception): ... + +def parse( + xml_input: str | bytes | SupportsRead[bytes], + encoding: str | None = ..., + expat: Any = ..., + process_namespaces: bool = ..., + namespace_separator: str = ..., + disable_entities: bool = ..., + **kwargs: Any, +) -> OrderedDict[str, Any]: ... +@overload +def unparse( + input_dict: Mapping[str, Any], + output: SupportsWrite[bytes] | SupportsWrite[str], + encoding: str = ..., + full_document: bool = ..., + short_empty_elements: bool = ..., + **kwargs: Any, +) -> None: ... +@overload +def unparse( + input_dict: Mapping[str, Any], + output: None = ..., + encoding: str = ..., + full_document: bool = ..., + short_empty_elements: bool = ..., + **kwargs: Any, +) -> str: ...