461bf6fd40
CI / lint (3.11) (push) Has been cancelled
CI / lint (3.12) (push) Has been cancelled
CI / lint (3.13) (push) Has been cancelled
CI / shellcheck (push) Has been cancelled
CI / shfmt (push) Has been cancelled
CI / setup (3.11) (push) Has been cancelled
CI / setup (3.12) (push) Has been cancelled
CI / setup (3.13) (push) Has been cancelled
CI / check-licenses (3.12) (push) Has been cancelled
CI / test_unit (3.11) (push) Has been cancelled
CI / test_unit (3.12) (push) Has been cancelled
CI / test_unit (3.13) (push) Has been cancelled
CI / test_unit_no_extras (3.11) (push) Has been cancelled
CI / test_unit_no_extras (3.12) (push) Has been cancelled
CI / test_json_to_html (3.12) (push) Has been cancelled
CI / test_unit_no_extras (3.13) (push) Has been cancelled
CI / test_unit_dependency_extras (csv, 3.12, --extra csv) (push) Has been cancelled
CI / test_unit_dependency_extras (xlsx, 3.11, --extra xlsx) (push) Has been cancelled
CI / test_unit_dependency_extras (xlsx, 3.12, --extra xlsx) (push) Has been cancelled
CI / test_unit_dependency_extras (csv, 3.11, --extra csv) (push) Has been cancelled
CI / test_unit_dependency_extras (csv, 3.13, --extra csv) (push) Has been cancelled
CI / test_unit_dependency_extras (docx, 3.11, --extra docx) (push) Has been cancelled
CI / test_unit_dependency_extras (docx, 3.12, --extra docx) (push) Has been cancelled
CI / test_unit_dependency_extras (docx, 3.13, --extra docx) (push) Has been cancelled
CI / test_unit_dependency_extras (markdown, 3.11, --extra md) (push) Has been cancelled
CI / test_unit_dependency_extras (markdown, 3.12, --extra md) (push) Has been cancelled
CI / test_unit_dependency_extras (markdown, 3.13, --extra md) (push) Has been cancelled
CI / test_unit_dependency_extras (odt, 3.11, --extra odt) (push) Has been cancelled
CI / test_unit_dependency_extras (odt, 3.12, --extra odt) (push) Has been cancelled
CI / test_unit_dependency_extras (odt, 3.13, --extra odt) (push) Has been cancelled
CI / test_unit_dependency_extras (pdf-image, 3.11, --extra pdf --extra image --extra paddleocr) (push) Has been cancelled
CI / test_unit_dependency_extras (pdf-image, 3.12, --extra pdf --extra image --extra paddleocr) (push) Has been cancelled
CI / test_unit_dependency_extras (pdf-image, 3.13, --extra pdf --extra image --extra paddleocr) (push) Has been cancelled
CI / test_unit_dependency_extras (pptx, 3.11, --extra pptx) (push) Has been cancelled
CI / test_unit_dependency_extras (pptx, 3.12, --extra pptx) (push) Has been cancelled
CI / test_unit_dependency_extras (pptx, 3.13, --extra pptx) (push) Has been cancelled
CI / test_unit_dependency_extras (pypandoc, 3.11, --extra epub --extra org --extra rtf --extra rst) (push) Has been cancelled
CI / test_unit_dependency_extras (pypandoc, 3.12, --extra epub --extra org --extra rtf --extra rst) (push) Has been cancelled
CI / test_unit_dependency_extras (pypandoc, 3.13, --extra epub --extra org --extra rtf --extra rst) (push) Has been cancelled
Build And Push Docker Image / set-short-sha (push) Has been cancelled
Partition Benchmark / setup (push) Has been cancelled
Partition Benchmark / Measure and compare partition() runtime (push) Has been cancelled
CI / test_unit_dependency_extras (xlsx, 3.13, --extra xlsx) (push) Has been cancelled
CI / test_ingest_src (3.12) (push) Has been cancelled
CI / test_json_to_markdown (3.12) (push) Has been cancelled
CI / changelog (push) Has been cancelled
CI / test_dockerfile (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Build And Push Docker Image / build-images (linux/amd64, opensource-linux-8core) (push) Has been cancelled
Build And Push Docker Image / build-images (linux/arm64, ubuntu-24.04-arm) (push) Has been cancelled
Build And Push Docker Image / publish-images (push) Has been cancelled
85 lines
2.8 KiB
Python
85 lines
2.8 KiB
Python
# pyright: reportPrivateUsage=false
|
|
|
|
from __future__ import annotations
|
|
|
|
from typing import Collection, Generic, Iterable, Iterator, TypeVar, overload
|
|
|
|
from typing_extensions import Self
|
|
|
|
from .. import _types as _t
|
|
from ._module_misc import CDATA, QName
|
|
|
|
_T = TypeVar("_T")
|
|
|
|
class _Element:
|
|
@overload
|
|
def __getitem__(self, __x: int) -> Self: ...
|
|
@overload
|
|
def __getitem__(self, __x: slice) -> list[Self]: ...
|
|
def __contains__(self, __o: object) -> bool: ...
|
|
def __len__(self) -> int: ...
|
|
def __iter__(self) -> Iterator[Self]: ...
|
|
def clear(self, keep_tail: bool = False) -> None: ...
|
|
def find(self, path: _t._ElemPathArg) -> Self | None: ...
|
|
@overload
|
|
def get(self, key: _t._AttrName) -> str | None: ...
|
|
@overload
|
|
def get(self, key: _t._AttrName, default: _T) -> str | _T: ...
|
|
def getparent(self) -> Self | None: ...
|
|
@overload
|
|
def iter(self, *tags: _t._TagSelector) -> Iterator[Self]: ...
|
|
@overload
|
|
def iter(
|
|
self, *, tag: _t._TagSelector | Iterable[_t._TagSelector] | None = None
|
|
) -> Iterator[Self]: ...
|
|
def iterancestors(
|
|
self, *, tag: _t._TagSelector | Collection[_t._TagSelector] | None = None
|
|
) -> Iterator[Self]: ...
|
|
@overload
|
|
def itertext(self, *tags: _t._TagSelector, with_tail: bool = True) -> Iterator[str]: ...
|
|
@overload
|
|
def itertext(
|
|
self,
|
|
*,
|
|
tag: _t._TagSelector | Collection[_t._TagSelector] | None = None,
|
|
with_tail: bool = True,
|
|
) -> Iterator[str]: ...
|
|
@property
|
|
def tag(self) -> str: ...
|
|
@property
|
|
def tail(self) -> str | None: ...
|
|
@tail.setter
|
|
def tail(self, value: str | CDATA | None) -> None: ...
|
|
@property
|
|
def text(self) -> str | None: ...
|
|
@text.setter
|
|
def text(self, value: str | QName | CDATA | None) -> None: ...
|
|
def xpath(
|
|
self,
|
|
_path: str,
|
|
/,
|
|
) -> _t._XPathObject: ...
|
|
|
|
class _ElementTree(Generic[_t._ET_co]): ...
|
|
|
|
# Behaves like MutableMapping but deviates a lot in details
|
|
class _Attrib:
|
|
def __bool__(self) -> bool: ...
|
|
def __contains__(self, __o: object) -> bool: ...
|
|
def __delitem__(self, __k: _t._AttrName) -> None: ...
|
|
def __getitem__(self, __k: _t._AttrName) -> str: ...
|
|
def __iter__(self) -> Iterator[str]: ...
|
|
def __len__(self) -> int: ...
|
|
def __setitem__(self, __k: _t._AttrName, __v: _t._AttrVal) -> None: ...
|
|
@property
|
|
def _element(self) -> _Element: ...
|
|
def clear(self) -> None: ...
|
|
def get(self, key: _t._AttrName, default: _T) -> str | _T: ...
|
|
def has_key(self, key: _t._AttrName) -> bool: ...
|
|
def items(self) -> list[tuple[str, str]]: ...
|
|
def iteritems(self) -> Iterator[tuple[str, str]]: ...
|
|
def iterkeys(self) -> Iterator[str]: ...
|
|
def itervalues(self) -> Iterator[str]: ...
|
|
def keys(self) -> list[str]: ...
|
|
def values(self) -> list[str]: ...
|