|
| 1 | +import re |
| 2 | +from _typeshed import ConvertibleToInt |
| 3 | +from collections.abc import Callable, Sequence |
| 4 | +from datetime import date, datetime, time, timedelta |
| 5 | +from typing import Any, Literal |
| 6 | + |
| 7 | +class ValidationError(ValueError): ... |
| 8 | + |
| 9 | +def check_ip(s: str) -> str: ... |
| 10 | +def check_positive(s: ConvertibleToInt) -> int: ... |
| 11 | +def check_identifier(s: str) -> str: ... |
| 12 | + |
| 13 | +isbn_re: re.Pattern[str] |
| 14 | + |
| 15 | +def isbn10_checksum(digits: Sequence[ConvertibleToInt]) -> str: ... |
| 16 | +def isbn13_checksum(digits: Sequence[ConvertibleToInt]) -> str: ... |
| 17 | +def check_isbn(s: str, convert_to: Literal[10, 13] | None = None) -> str: ... |
| 18 | +def isbn10_to_isbn13(s: str) -> str: ... |
| 19 | +def isbn13_to_isbn10(s: str) -> str: ... |
| 20 | + |
| 21 | +email_re: re.Pattern[str] |
| 22 | +rfc2822_email_re: re.Pattern[str] |
| 23 | + |
| 24 | +def check_email(s: str) -> str: ... |
| 25 | +def check_rfc2822_email(s: str) -> str: ... |
| 26 | + |
| 27 | +date_str_list: list[str] |
| 28 | +date_re_list: list[re.Pattern[str]] |
| 29 | +time_str: str |
| 30 | +time_re: re.Pattern[str] |
| 31 | +datetime_re_list: list[re.Pattern[str]] |
| 32 | +month_lists: list[list[str]] |
| 33 | +month_list: list[str] |
| 34 | +i: int |
| 35 | +month: str |
| 36 | +month_dict: dict[str, int] |
| 37 | + |
| 38 | +def str2date(s: str) -> date: ... |
| 39 | +def str2time(s: str) -> time: ... |
| 40 | +def str2datetime(s: str) -> datetime: ... |
| 41 | +def str2timedelta(s: str) -> timedelta: ... |
| 42 | +def timedelta2str(td: timedelta) -> str: ... |
| 43 | + |
| 44 | +converters: dict[type | str, tuple[Callable[[str], Any], type[str], str | None]] # Any type from types above |
| 45 | + |
| 46 | +def str2py( |
| 47 | + value: str, type: str | type | tuple[Callable[[str], Any], type[str], str | None] | None |
| 48 | +) -> Any: ... # Any type from types above |
0 commit comments