From a5ddf0bf0d84beb9081fc3d3cfde2991585f1da5 Mon Sep 17 00:00:00 2001 From: Andrej Shadura Date: Fri, 11 Mar 2022 12:19:51 +0100 Subject: [PATCH] Add xmltodict (#7472) Signed-off-by: Andrej Shadura --- stubs/xmltodict/METADATA.toml | 1 + stubs/xmltodict/xmltodict.pyi | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 stubs/xmltodict/METADATA.toml create mode 100644 stubs/xmltodict/xmltodict.pyi 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: ...