|
| 1 | +from ipaddress import IPv4Address, IPv6Address |
| 2 | +from os import PathLike |
| 3 | +from typing import Any, AnyStr, IO, Mapping, Optional, Sequence, Text, Tuple, Union |
| 4 | + |
| 5 | +from maxminddb import MODE_AUTO |
| 6 | +from maxminddb.errors import InvalidDatabaseError as InvalidDatabaseError |
| 7 | +from maxminddb.types import Record |
| 8 | + |
| 9 | +class Reader: |
| 10 | + closed: bool = ... |
| 11 | + def __init__( |
| 12 | + self, database: Union[AnyStr, int, PathLike, IO], mode: int = MODE_AUTO |
| 13 | + ) -> None: ... |
| 14 | + def close(self) -> None: ... |
| 15 | + def get( |
| 16 | + self, ip_address: Union[str, IPv6Address, IPv4Address] |
| 17 | + ) -> Optional[Record]: ... |
| 18 | + def get_with_prefix_len( |
| 19 | + self, ip_address: Union[str, IPv6Address, IPv4Address] |
| 20 | + ) -> Tuple[Optional[Record], int]: ... |
| 21 | + def metadata(self) -> "Metadata": ... |
| 22 | + def __enter__(self) -> "Reader": ... |
| 23 | + def __exit__(self, *args) -> None: ... |
| 24 | + |
| 25 | +class Metadata: |
| 26 | + @property |
| 27 | + def node_count(self) -> int: ... |
| 28 | + @property |
| 29 | + def record_size(self) -> int: ... |
| 30 | + @property |
| 31 | + def ip_version(self) -> int: ... |
| 32 | + @property |
| 33 | + def database_type(self) -> Text: ... |
| 34 | + @property |
| 35 | + def languages(self) -> Sequence[Text]: ... |
| 36 | + @property |
| 37 | + def binary_format_major_version(self) -> int: ... |
| 38 | + @property |
| 39 | + def binary_format_minor_version(self) -> int: ... |
| 40 | + @property |
| 41 | + def build_epoch(self) -> int: ... |
| 42 | + @property |
| 43 | + def description(self) -> Mapping[Text, Text]: ... |
| 44 | + def __init__(self, **kwargs: Any) -> None: ... |
0 commit comments