mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-06 12:14:27 +08:00
Revised stubs for geoip2 third party library (#3317)
This commit is contained in:
committed by
Jelle Zijlstra
parent
f0ccb325aa
commit
57384ce033
9
third_party/3/maxminddb/__init__.pyi
vendored
9
third_party/3/maxminddb/__init__.pyi
vendored
@@ -1,9 +0,0 @@
|
||||
# Stubs for maxminddb (Python 3)
|
||||
|
||||
from typing import Any
|
||||
|
||||
from maxminddb import reader
|
||||
|
||||
def open_database(database: str, mode: int = ...) -> reader.Reader: ...
|
||||
|
||||
def Reader(database: str) -> reader.Reader: ...
|
||||
10
third_party/3/maxminddb/compat.pyi
vendored
10
third_party/3/maxminddb/compat.pyi
vendored
@@ -1,10 +0,0 @@
|
||||
# Stubs for maxminddb.compat (Python 3)
|
||||
|
||||
from ipaddress import IPv4Address, IPv6Address
|
||||
|
||||
from typing import Any
|
||||
|
||||
def compat_ip_address(address: object) -> Any: ...
|
||||
def int_from_byte(x: int) -> int: ...
|
||||
def int_from_bytes(x: bytes) -> int: ...
|
||||
def byte_from_int(x: int) -> bytes: ...
|
||||
8
third_party/3/maxminddb/const.pyi
vendored
8
third_party/3/maxminddb/const.pyi
vendored
@@ -1,8 +0,0 @@
|
||||
# Stubs for maxminddb.const (Python 3)
|
||||
|
||||
MODE_AUTO: int = ...
|
||||
MODE_MMAP_EXT: int = ...
|
||||
MODE_MMAP: int = ...
|
||||
MODE_FILE: int = ...
|
||||
MODE_MEMORY: int = ...
|
||||
MODE_FD: int = ...
|
||||
7
third_party/3/maxminddb/decoder.pyi
vendored
7
third_party/3/maxminddb/decoder.pyi
vendored
@@ -1,7 +0,0 @@
|
||||
# Stubs for maxminddb.decoder (Python 3)
|
||||
|
||||
from typing import Any, Tuple
|
||||
|
||||
class Decoder:
|
||||
def __init__(self, database_buffer: bytes, pointer_base: int = ..., pointer_test: bool = ...) -> None: ...
|
||||
def decode(self, offset: int) -> Tuple[Any, int]: ...
|
||||
3
third_party/3/maxminddb/errors.pyi
vendored
3
third_party/3/maxminddb/errors.pyi
vendored
@@ -1,3 +0,0 @@
|
||||
# Stubs for maxminddb.errors (Python 3)
|
||||
|
||||
class InvalidDatabaseError(RuntimeError): ...
|
||||
35
third_party/3/maxminddb/extension.pyi
vendored
35
third_party/3/maxminddb/extension.pyi
vendored
@@ -1,35 +0,0 @@
|
||||
# Stubs for maxminddb.extension (Python 3)
|
||||
|
||||
from typing import Any, Mapping, Sequence
|
||||
|
||||
from maxminddb.errors import InvalidDatabaseError as InvalidDatabaseError
|
||||
|
||||
class Reader:
|
||||
closed: bool = ...
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
def close(self, *args: Any, **kwargs: Any) -> Any: ...
|
||||
def get(self, *args: Any, **kwargs: Any) -> Any: ...
|
||||
def metadata(self, *args: Any, **kwargs: Any) -> Any: ...
|
||||
def __enter__(self, *args: Any, **kwargs: Any) -> Any: ...
|
||||
def __exit__(self, *args: Any, **kwargs: Any) -> Any: ...
|
||||
|
||||
class extension:
|
||||
@property
|
||||
def node_count(self) -> int: ...
|
||||
@property
|
||||
def record_size(self) -> int: ...
|
||||
@property
|
||||
def ip_version(self) -> int: ...
|
||||
@property
|
||||
def database_type(self) -> str: ...
|
||||
@property
|
||||
def languages(self) -> Sequence[str]: ...
|
||||
@property
|
||||
def binary_format_major_version(self) -> int: ...
|
||||
@property
|
||||
def binary_format_minor_version(self) -> int: ...
|
||||
@property
|
||||
def build_epoch(self) -> int: ...
|
||||
@property
|
||||
def description(self) -> Mapping[str, str]: ...
|
||||
def __init__(self, **kwargs: Any) -> None: ...
|
||||
32
third_party/3/maxminddb/reader.pyi
vendored
32
third_party/3/maxminddb/reader.pyi
vendored
@@ -1,32 +0,0 @@
|
||||
# Stubs for maxminddb.reader (Python 3)
|
||||
|
||||
from ipaddress import IPv4Address, IPv6Address
|
||||
|
||||
from types import TracebackType
|
||||
from typing import Any, Mapping, Optional, Sequence, Tuple, Type, Union
|
||||
|
||||
class Reader:
|
||||
closed: bool = ...
|
||||
def __init__(self, database: bytes, mode: int = ...) -> None: ...
|
||||
def metadata(self) -> Metadata: ...
|
||||
def get(self, ip_address: Union[str, IPv4Address, IPv6Address]) -> Optional[Any]: ...
|
||||
def get_with_prefix_len(self, ip_address: Union[str, IPv4Address, IPv6Address]) -> Tuple[Optional[Any], int]: ...
|
||||
def close(self) -> None: ...
|
||||
def __enter__(self) -> Reader: ...
|
||||
def __exit__(self, exc_type: Optional[Type[BaseException]] = ..., exc_val: Optional[BaseException] = ..., exc_tb: Optional[TracebackType] = ...) -> None: ...
|
||||
|
||||
class Metadata:
|
||||
node_count: int = ...
|
||||
record_size: int = ...
|
||||
ip_version: int = ...
|
||||
database_type: str = ...
|
||||
languages: Sequence[str] = ...
|
||||
binary_format_major_version: int = ...
|
||||
binary_format_minor_version: int = ...
|
||||
build_epoch: int = ...
|
||||
description: Mapping[str, str] = ...
|
||||
def __init__(self, **kwargs: Any) -> None: ...
|
||||
@property
|
||||
def node_byte_size(self) -> int: ...
|
||||
@property
|
||||
def search_tree_size(self) -> int: ...
|
||||
Reference in New Issue
Block a user