maxminddb 2.5.2__tar.gz → 2.6.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. {maxminddb-2.5.2 → maxminddb-2.6.1}/HISTORY.rst +18 -0
  2. {maxminddb-2.5.2/maxminddb.egg-info → maxminddb-2.6.1}/PKG-INFO +1 -2
  3. {maxminddb-2.5.2 → maxminddb-2.6.1}/docs/conf.py +1 -1
  4. {maxminddb-2.5.2 → maxminddb-2.6.1}/docs/index.rst +1 -1
  5. {maxminddb-2.5.2 → maxminddb-2.6.1}/maxminddb/__init__.py +2 -2
  6. {maxminddb-2.5.2 → maxminddb-2.6.1}/maxminddb/decoder.py +1 -0
  7. maxminddb-2.6.1/maxminddb/extension.pyi +116 -0
  8. {maxminddb-2.5.2 → maxminddb-2.6.1}/maxminddb/reader.py +44 -55
  9. {maxminddb-2.5.2 → maxminddb-2.6.1}/maxminddb/types.py +1 -0
  10. {maxminddb-2.5.2 → maxminddb-2.6.1/maxminddb.egg-info}/PKG-INFO +1 -2
  11. {maxminddb-2.5.2 → maxminddb-2.6.1}/maxminddb.egg-info/SOURCES.txt +0 -1
  12. {maxminddb-2.5.2 → maxminddb-2.6.1}/pyproject.toml +2 -5
  13. maxminddb-2.5.2/maxminddb/extension.pyi +0 -44
  14. maxminddb-2.5.2/maxminddb.egg-info/requires.txt +0 -1
  15. {maxminddb-2.5.2 → maxminddb-2.6.1}/LICENSE +0 -0
  16. {maxminddb-2.5.2 → maxminddb-2.6.1}/MANIFEST.in +0 -0
  17. {maxminddb-2.5.2 → maxminddb-2.6.1}/README.rst +0 -0
  18. {maxminddb-2.5.2 → maxminddb-2.6.1}/docs/Makefile +0 -0
  19. {maxminddb-2.5.2 → maxminddb-2.6.1}/examples/benchmark.py +0 -0
  20. {maxminddb-2.5.2 → maxminddb-2.6.1}/extension/libmaxminddb/include/maxminddb.h +0 -0
  21. {maxminddb-2.5.2 → maxminddb-2.6.1}/extension/libmaxminddb/src/data-pool.c +0 -0
  22. {maxminddb-2.5.2 → maxminddb-2.6.1}/extension/libmaxminddb/src/data-pool.h +0 -0
  23. {maxminddb-2.5.2 → maxminddb-2.6.1}/extension/libmaxminddb/src/maxminddb-compat-util.h +0 -0
  24. {maxminddb-2.5.2 → maxminddb-2.6.1}/extension/libmaxminddb/src/maxminddb.c +0 -0
  25. {maxminddb-2.5.2 → maxminddb-2.6.1}/extension/maxminddb.c +0 -0
  26. {maxminddb-2.5.2 → maxminddb-2.6.1}/extension/maxminddb_config.h +0 -0
  27. {maxminddb-2.5.2 → maxminddb-2.6.1}/maxminddb/const.py +0 -0
  28. {maxminddb-2.5.2 → maxminddb-2.6.1}/maxminddb/errors.py +0 -0
  29. {maxminddb-2.5.2 → maxminddb-2.6.1}/maxminddb/file.py +0 -0
  30. {maxminddb-2.5.2 → maxminddb-2.6.1}/maxminddb/py.typed +0 -0
  31. {maxminddb-2.5.2 → maxminddb-2.6.1}/maxminddb.egg-info/dependency_links.txt +0 -0
  32. {maxminddb-2.5.2 → maxminddb-2.6.1}/maxminddb.egg-info/top_level.txt +0 -0
  33. {maxminddb-2.5.2 → maxminddb-2.6.1}/setup.cfg +0 -0
  34. {maxminddb-2.5.2 → maxminddb-2.6.1}/setup.py +0 -0
  35. {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/bad-data/libmaxminddb/libmaxminddb-offset-integer-overflow.mmdb +0 -0
  36. {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/bad-data/maxminddb-golang/cyclic-data-structure.mmdb +0 -0
  37. {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/bad-data/maxminddb-golang/invalid-bytes-length.mmdb +0 -0
  38. {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/bad-data/maxminddb-golang/invalid-data-record-offset.mmdb +0 -0
  39. {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/bad-data/maxminddb-golang/invalid-map-key-length.mmdb +0 -0
  40. {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/bad-data/maxminddb-golang/invalid-string-length.mmdb +0 -0
  41. {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/bad-data/maxminddb-golang/metadata-is-an-uint128.mmdb +0 -0
  42. {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/bad-data/maxminddb-golang/unexpected-bytes.mmdb +0 -0
  43. {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/bad-data/maxminddb-python/bad-unicode-in-map-key.mmdb +0 -0
  44. {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/GeoIP2-Anonymous-IP-Test.mmdb +0 -0
  45. {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/GeoIP2-City-Test-Broken-Double-Format.mmdb +0 -0
  46. {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/GeoIP2-City-Test-Invalid-Node-Count.mmdb +0 -0
  47. {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/GeoIP2-City-Test.mmdb +0 -0
  48. {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/GeoIP2-Connection-Type-Test.mmdb +0 -0
  49. {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/GeoIP2-Country-Test.mmdb +0 -0
  50. {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/GeoIP2-DensityIncome-Test.mmdb +0 -0
  51. {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/GeoIP2-Domain-Test.mmdb +0 -0
  52. {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/GeoIP2-Enterprise-Test.mmdb +0 -0
  53. {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/GeoIP2-ISP-Test.mmdb +0 -0
  54. {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/GeoIP2-Precision-Enterprise-Test.mmdb +0 -0
  55. {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/GeoIP2-Static-IP-Score-Test.mmdb +0 -0
  56. {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/GeoIP2-User-Count-Test.mmdb +0 -0
  57. {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/GeoLite2-ASN-Test.mmdb +0 -0
  58. {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/GeoLite2-City-Test.mmdb +0 -0
  59. {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/GeoLite2-Country-Test.mmdb +0 -0
  60. {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/MaxMind-DB-no-ipv4-search-tree.mmdb +0 -0
  61. {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/MaxMind-DB-string-value-entries.mmdb +0 -0
  62. {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/MaxMind-DB-test-broken-pointers-24.mmdb +0 -0
  63. {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/MaxMind-DB-test-broken-search-tree-24.mmdb +0 -0
  64. {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/MaxMind-DB-test-decoder.mmdb +0 -0
  65. {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/MaxMind-DB-test-ipv4-24.mmdb +0 -0
  66. {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/MaxMind-DB-test-ipv4-28.mmdb +0 -0
  67. {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/MaxMind-DB-test-ipv4-32.mmdb +0 -0
  68. {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/MaxMind-DB-test-ipv6-24.mmdb +0 -0
  69. {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/MaxMind-DB-test-ipv6-28.mmdb +0 -0
  70. {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/MaxMind-DB-test-ipv6-32.mmdb +0 -0
  71. {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/MaxMind-DB-test-metadata-pointers.mmdb +0 -0
  72. {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/MaxMind-DB-test-mixed-24.mmdb +0 -0
  73. {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/MaxMind-DB-test-mixed-28.mmdb +0 -0
  74. {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/MaxMind-DB-test-mixed-32.mmdb +0 -0
  75. {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/MaxMind-DB-test-nested.mmdb +0 -0
  76. {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/MaxMind-DB-test-pointer-decoder.mmdb +0 -0
  77. {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/maps-with-pointers.raw +0 -0
  78. {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/decoder_test.py +0 -0
  79. {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/reader_test.py +0 -0
@@ -3,6 +3,24 @@
3
3
  History
4
4
  -------
5
5
 
6
+ 2.6.1 (2024-04-12)
7
+ ++++++++++++++++++
8
+
9
+ * This release includes no source code changes. The only changes are to
10
+ the release workflow.
11
+ * Binary wheels are now built on Linux for aarch64. Pull request by Kevin
12
+ Park. GitHub #160.
13
+ * Binary wheels are now built on macOS for Apple silicon. Requested by
14
+ Kevin Park. GitHub #152.
15
+
16
+ 2.6.0 (2024-03-19)
17
+ ++++++++++++++++++
18
+
19
+ * Added type annotations for instance variables on ``Metadata``
20
+ * Updated type stubs for ``maxminddb.extension``.
21
+ * ``setuptools`` is no longer listed as a runtime dependency. Pull request
22
+ by Lewis Collard. GitHub #155.
23
+
6
24
  2.5.2 (2024-01-09)
7
25
  ++++++++++++++++++
8
26
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: maxminddb
3
- Version: 2.5.2
3
+ Version: 2.6.1
4
4
  Summary: Reader for the MaxMind DB format
5
5
  Author-email: Gregory Oschwald <goschwald@maxmind.com>
6
6
  License: Apache License, Version 2.0
@@ -25,7 +25,6 @@ Classifier: Topic :: Internet :: Proxy Servers
25
25
  Requires-Python: >=3.8
26
26
  Description-Content-Type: text/x-rst
27
27
  License-File: LICENSE
28
- Requires-Dist: setuptools>=68.2.2
29
28
 
30
29
  ========================
31
30
  MaxMind DB Python Module
@@ -53,7 +53,7 @@ master_doc = "index"
53
53
 
54
54
  # General information about the project.
55
55
  project = "maxminddb"
56
- copyright = "2013-2023, MaxMind, Inc."
56
+ copyright = "2013-2024, MaxMind, Inc."
57
57
 
58
58
  # The version info for the project you're documenting, acts as replacement for
59
59
  # |version| and |release|, also used in various other places throughout the
@@ -35,6 +35,6 @@ Indices and tables
35
35
  * :ref:`modindex`
36
36
  * :ref:`search`
37
37
 
38
- :copyright: (c) 2013-2023 by MaxMind, Inc.
38
+ :copyright: (c) 2013-2024 by MaxMind, Inc.
39
39
  :license: Apache License, Version 2.0
40
40
 
@@ -81,7 +81,7 @@ def open_database(
81
81
 
82
82
 
83
83
  __title__ = "maxminddb"
84
- __version__ = "2.5.2"
84
+ __version__ = "2.6.1"
85
85
  __author__ = "Gregory Oschwald"
86
86
  __license__ = "Apache License, Version 2.0"
87
- __copyright__ = "Copyright 2013-2023 MaxMind, Inc."
87
+ __copyright__ = "Copyright 2013-2024 MaxMind, Inc."
@@ -5,6 +5,7 @@ maxminddb.decoder
5
5
  This package contains code for decoding the MaxMind DB data section.
6
6
 
7
7
  """
8
+
8
9
  import struct
9
10
  from typing import cast, Dict, List, Tuple, Union
10
11
 
@@ -0,0 +1,116 @@
1
+ """
2
+ maxminddb.extension
3
+ ~~~~~~~~~~~~~~~~
4
+
5
+ This module contains the C extension database reader and related classes.
6
+
7
+ """
8
+
9
+ from ipaddress import IPv4Address, IPv6Address
10
+ from os import PathLike
11
+ from typing import Any, AnyStr, Dict, IO, List, Optional, Tuple, Union
12
+ from maxminddb import MODE_AUTO
13
+ from maxminddb.types import Record
14
+
15
+ class Reader:
16
+ """
17
+ A C extension implementation of a reader for the MaxMind DB format. IP
18
+ addresses can be looked up using the ``get`` method.
19
+ """
20
+
21
+ closed: bool = ...
22
+
23
+ def __init__(
24
+ self, database: Union[AnyStr, int, PathLike, IO], mode: int = MODE_AUTO
25
+ ) -> None:
26
+ """Reader for the MaxMind DB file format
27
+
28
+ Arguments:
29
+ database -- A path to a valid MaxMind DB file such as a GeoIP2 database
30
+ file, or a file descriptor in the case of MODE_FD.
31
+ mode -- mode to open the database with. The only supported modes are
32
+ MODE_AUTO and MODE_MMAP_EXT.
33
+ """
34
+
35
+ def close(self) -> None:
36
+ """Closes the MaxMind DB file and returns the resources to the system"""
37
+
38
+ def get(self, ip_address: Union[str, IPv6Address, IPv4Address]) -> Optional[Record]:
39
+ """Return the record for the ip_address in the MaxMind DB
40
+
41
+
42
+ Arguments:
43
+ ip_address -- an IP address in the standard string notation
44
+ """
45
+
46
+ def get_with_prefix_len(
47
+ self, ip_address: Union[str, IPv6Address, IPv4Address]
48
+ ) -> Tuple[Optional[Record], int]:
49
+ """Return a tuple with the record and the associated prefix length
50
+
51
+
52
+ Arguments:
53
+ ip_address -- an IP address in the standard string notation
54
+ """
55
+
56
+ def metadata(self) -> "Metadata":
57
+ """Return the metadata associated with the MaxMind DB file"""
58
+
59
+ def __enter__(self) -> "Reader": ...
60
+ def __exit__(self, *args) -> None: ...
61
+
62
+ # pylint: disable=too-few-public-methods
63
+ class Metadata:
64
+ """Metadata for the MaxMind DB reader"""
65
+
66
+ binary_format_major_version: int
67
+ """
68
+ The major version number of the binary format used when creating the
69
+ database.
70
+ """
71
+
72
+ binary_format_minor_version: int
73
+ """
74
+ The minor version number of the binary format used when creating the
75
+ database.
76
+ """
77
+
78
+ build_epoch: int
79
+ """
80
+ The Unix epoch for the build time of the database.
81
+ """
82
+
83
+ database_type: str
84
+ """
85
+ A string identifying the database type, e.g., "GeoIP2-City".
86
+ """
87
+
88
+ description: Dict[str, str]
89
+ """
90
+ A map from locales to text descriptions of the database.
91
+ """
92
+
93
+ ip_version: int
94
+ """
95
+ The IP version of the data in a database. A value of "4" means the
96
+ database only supports IPv4. A database with a value of "6" may support
97
+ both IPv4 and IPv6 lookups.
98
+ """
99
+
100
+ languages: List[str]
101
+ """
102
+ A list of locale codes supported by the databse.
103
+ """
104
+
105
+ node_count: int
106
+ """
107
+ The number of nodes in the database.
108
+ """
109
+
110
+ record_size: int
111
+ """
112
+ The bit size of a record in the search tree.
113
+ """
114
+
115
+ def __init__(self, **kwargs: Any) -> None:
116
+ """Creates new Metadata object. kwargs are key/value pairs from spec"""
@@ -5,6 +5,7 @@ maxminddb.reader
5
5
  This module contains the pure Python database reader and related classes.
6
6
 
7
7
  """
8
+
8
9
  try:
9
10
  import mmap
10
11
  except ImportError:
@@ -15,7 +16,7 @@ import ipaddress
15
16
  import struct
16
17
  from ipaddress import IPv4Address, IPv6Address
17
18
  from os import PathLike
18
- from typing import Any, AnyStr, IO, Optional, Tuple, Union
19
+ from typing import Any, AnyStr, Dict, IO, List, Optional, Tuple, Union
19
20
 
20
21
  from maxminddb.const import MODE_AUTO, MODE_MMAP, MODE_FILE, MODE_MEMORY, MODE_FD
21
22
  from maxminddb.decoder import Decoder
@@ -28,7 +29,7 @@ _IPV4_MAX_NUM = 2**32
28
29
 
29
30
  class Reader:
30
31
  """
31
- Instances of this class provide a reader for the MaxMind DB format. IP
32
+ A pure Python implementation of a reader for the MaxMind DB format. IP
32
33
  addresses can be looked up using the ``get`` method.
33
34
  """
34
35
 
@@ -268,71 +269,59 @@ class Reader:
268
269
  return self
269
270
 
270
271
 
272
+ # pylint: disable=too-many-instance-attributes,R0801
271
273
  class Metadata:
272
- """Metadata for the MaxMind DB reader
273
-
274
-
275
- .. attribute:: binary_format_major_version
276
-
277
- The major version number of the binary format used when creating the
278
- database.
279
-
280
- :type: int
281
-
282
- .. attribute:: binary_format_minor_version
283
-
284
- The minor version number of the binary format used when creating the
285
- database.
286
-
287
- :type: int
288
-
289
- .. attribute:: build_epoch
290
-
291
- The Unix epoch for the build time of the database.
292
-
293
- :type: int
294
-
295
- .. attribute:: database_type
296
-
297
- A string identifying the database type, e.g., "GeoIP2-City".
298
-
299
- :type: str
300
-
301
- .. attribute:: description
302
-
303
- A map from locales to text descriptions of the database.
304
-
305
- :type: dict(str, str)
306
-
307
- .. attribute:: ip_version
308
-
309
- The IP version of the data in a database. A value of "4" means the
310
- database only supports IPv4. A database with a value of "6" may support
311
- both IPv4 and IPv6 lookups.
274
+ """Metadata for the MaxMind DB reader"""
312
275
 
313
- :type: int
314
-
315
- .. attribute:: languages
316
-
317
- A list of locale codes supported by the databse.
276
+ binary_format_major_version: int
277
+ """
278
+ The major version number of the binary format used when creating the
279
+ database.
280
+ """
318
281
 
319
- :type: list(str)
282
+ binary_format_minor_version: int
283
+ """
284
+ The minor version number of the binary format used when creating the
285
+ database.
286
+ """
320
287
 
321
- .. attribute:: node_count
288
+ build_epoch: int
289
+ """
290
+ The Unix epoch for the build time of the database.
291
+ """
322
292
 
323
- The number of nodes in the database.
293
+ database_type: str
294
+ """
295
+ A string identifying the database type, e.g., "GeoIP2-City".
296
+ """
324
297
 
325
- :type: int
298
+ description: Dict[str, str]
299
+ """
300
+ A map from locales to text descriptions of the database.
301
+ """
326
302
 
327
- .. attribute:: record_size
303
+ ip_version: int
304
+ """
305
+ The IP version of the data in a database. A value of "4" means the
306
+ database only supports IPv4. A database with a value of "6" may support
307
+ both IPv4 and IPv6 lookups.
308
+ """
328
309
 
329
- The bit size of a record in the search tree.
310
+ languages: List[str]
311
+ """
312
+ A list of locale codes supported by the databse.
313
+ """
330
314
 
331
- :type: int
315
+ node_count: int
316
+ """
317
+ The number of nodes in the database.
318
+ """
332
319
 
320
+ record_size: int
321
+ """
322
+ The bit size of a record in the search tree.
333
323
  """
334
324
 
335
- # pylint: disable=too-many-instance-attributes
336
325
  def __init__(self, **kwargs) -> None:
337
326
  """Creates new Metadata object. kwargs are key/value pairs from spec"""
338
327
  # Although I could just update __dict__, that is less obvious and it
@@ -4,6 +4,7 @@ maxminddb.types
4
4
 
5
5
  This module provides a Record type that represents a database record.
6
6
  """
7
+
7
8
  from typing import AnyStr, Dict, List, Union
8
9
 
9
10
  Primitive = Union[AnyStr, bool, float, int]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: maxminddb
3
- Version: 2.5.2
3
+ Version: 2.6.1
4
4
  Summary: Reader for the MaxMind DB format
5
5
  Author-email: Gregory Oschwald <goschwald@maxmind.com>
6
6
  License: Apache License, Version 2.0
@@ -25,7 +25,6 @@ Classifier: Topic :: Internet :: Proxy Servers
25
25
  Requires-Python: >=3.8
26
26
  Description-Content-Type: text/x-rst
27
27
  License-File: LICENSE
28
- Requires-Dist: setuptools>=68.2.2
29
28
 
30
29
  ========================
31
30
  MaxMind DB Python Module
@@ -28,7 +28,6 @@ maxminddb/types.py
28
28
  maxminddb.egg-info/PKG-INFO
29
29
  maxminddb.egg-info/SOURCES.txt
30
30
  maxminddb.egg-info/dependency_links.txt
31
- maxminddb.egg-info/requires.txt
32
31
  maxminddb.egg-info/top_level.txt
33
32
  tests/decoder_test.py
34
33
  tests/reader_test.py
@@ -1,17 +1,14 @@
1
1
  [build-system]
2
- requires = ["setuptools", "setuptools-scm", "wheel"]
2
+ requires = ["setuptools>=68.2.2", "setuptools-scm", "wheel"]
3
3
  build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "maxminddb"
7
- version = "2.5.2"
7
+ version = "2.6.1"
8
8
  description = "Reader for the MaxMind DB format"
9
9
  authors = [
10
10
  {name = "Gregory Oschwald", email = "goschwald@maxmind.com"},
11
11
  ]
12
- dependencies = [
13
- "setuptools>=68.2.2",
14
- ]
15
12
  requires-python = ">=3.8"
16
13
  readme = "README.rst"
17
14
  license = {text = "Apache License, Version 2.0"}
@@ -1,44 +0,0 @@
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: ...
@@ -1 +0,0 @@
1
- setuptools>=68.2.2
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes