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.
- {maxminddb-2.5.2 → maxminddb-2.6.1}/HISTORY.rst +18 -0
- {maxminddb-2.5.2/maxminddb.egg-info → maxminddb-2.6.1}/PKG-INFO +1 -2
- {maxminddb-2.5.2 → maxminddb-2.6.1}/docs/conf.py +1 -1
- {maxminddb-2.5.2 → maxminddb-2.6.1}/docs/index.rst +1 -1
- {maxminddb-2.5.2 → maxminddb-2.6.1}/maxminddb/__init__.py +2 -2
- {maxminddb-2.5.2 → maxminddb-2.6.1}/maxminddb/decoder.py +1 -0
- maxminddb-2.6.1/maxminddb/extension.pyi +116 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/maxminddb/reader.py +44 -55
- {maxminddb-2.5.2 → maxminddb-2.6.1}/maxminddb/types.py +1 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1/maxminddb.egg-info}/PKG-INFO +1 -2
- {maxminddb-2.5.2 → maxminddb-2.6.1}/maxminddb.egg-info/SOURCES.txt +0 -1
- {maxminddb-2.5.2 → maxminddb-2.6.1}/pyproject.toml +2 -5
- maxminddb-2.5.2/maxminddb/extension.pyi +0 -44
- maxminddb-2.5.2/maxminddb.egg-info/requires.txt +0 -1
- {maxminddb-2.5.2 → maxminddb-2.6.1}/LICENSE +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/MANIFEST.in +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/README.rst +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/docs/Makefile +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/examples/benchmark.py +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/extension/libmaxminddb/include/maxminddb.h +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/extension/libmaxminddb/src/data-pool.c +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/extension/libmaxminddb/src/data-pool.h +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/extension/libmaxminddb/src/maxminddb-compat-util.h +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/extension/libmaxminddb/src/maxminddb.c +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/extension/maxminddb.c +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/extension/maxminddb_config.h +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/maxminddb/const.py +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/maxminddb/errors.py +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/maxminddb/file.py +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/maxminddb/py.typed +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/maxminddb.egg-info/dependency_links.txt +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/maxminddb.egg-info/top_level.txt +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/setup.cfg +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/setup.py +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/bad-data/libmaxminddb/libmaxminddb-offset-integer-overflow.mmdb +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/bad-data/maxminddb-golang/cyclic-data-structure.mmdb +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/bad-data/maxminddb-golang/invalid-bytes-length.mmdb +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/bad-data/maxminddb-golang/invalid-data-record-offset.mmdb +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/bad-data/maxminddb-golang/invalid-map-key-length.mmdb +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/bad-data/maxminddb-golang/invalid-string-length.mmdb +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/bad-data/maxminddb-golang/metadata-is-an-uint128.mmdb +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/bad-data/maxminddb-golang/unexpected-bytes.mmdb +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/bad-data/maxminddb-python/bad-unicode-in-map-key.mmdb +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/GeoIP2-Anonymous-IP-Test.mmdb +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/GeoIP2-City-Test-Broken-Double-Format.mmdb +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/GeoIP2-City-Test-Invalid-Node-Count.mmdb +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/GeoIP2-City-Test.mmdb +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/GeoIP2-Connection-Type-Test.mmdb +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/GeoIP2-Country-Test.mmdb +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/GeoIP2-DensityIncome-Test.mmdb +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/GeoIP2-Domain-Test.mmdb +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/GeoIP2-Enterprise-Test.mmdb +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/GeoIP2-ISP-Test.mmdb +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/GeoIP2-Precision-Enterprise-Test.mmdb +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/GeoIP2-Static-IP-Score-Test.mmdb +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/GeoIP2-User-Count-Test.mmdb +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/GeoLite2-ASN-Test.mmdb +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/GeoLite2-City-Test.mmdb +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/GeoLite2-Country-Test.mmdb +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/MaxMind-DB-no-ipv4-search-tree.mmdb +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/MaxMind-DB-string-value-entries.mmdb +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/MaxMind-DB-test-broken-pointers-24.mmdb +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/MaxMind-DB-test-broken-search-tree-24.mmdb +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/MaxMind-DB-test-decoder.mmdb +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/MaxMind-DB-test-ipv4-24.mmdb +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/MaxMind-DB-test-ipv4-28.mmdb +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/MaxMind-DB-test-ipv4-32.mmdb +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/MaxMind-DB-test-ipv6-24.mmdb +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/MaxMind-DB-test-ipv6-28.mmdb +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/MaxMind-DB-test-ipv6-32.mmdb +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/MaxMind-DB-test-metadata-pointers.mmdb +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/MaxMind-DB-test-mixed-24.mmdb +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/MaxMind-DB-test-mixed-28.mmdb +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/MaxMind-DB-test-mixed-32.mmdb +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/MaxMind-DB-test-nested.mmdb +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/MaxMind-DB-test-pointer-decoder.mmdb +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/maps-with-pointers.raw +0 -0
- {maxminddb-2.5.2 → maxminddb-2.6.1}/tests/decoder_test.py +0 -0
- {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.
|
|
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-
|
|
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
|
|
@@ -81,7 +81,7 @@ def open_database(
|
|
|
81
81
|
|
|
82
82
|
|
|
83
83
|
__title__ = "maxminddb"
|
|
84
|
-
__version__ = "2.
|
|
84
|
+
__version__ = "2.6.1"
|
|
85
85
|
__author__ = "Gregory Oschwald"
|
|
86
86
|
__license__ = "Apache License, Version 2.0"
|
|
87
|
-
__copyright__ = "Copyright 2013-
|
|
87
|
+
__copyright__ = "Copyright 2013-2024 MaxMind, Inc."
|
|
@@ -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
|
-
|
|
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
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
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
|
-
|
|
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
|
-
|
|
288
|
+
build_epoch: int
|
|
289
|
+
"""
|
|
290
|
+
The Unix epoch for the build time of the database.
|
|
291
|
+
"""
|
|
322
292
|
|
|
323
|
-
|
|
293
|
+
database_type: str
|
|
294
|
+
"""
|
|
295
|
+
A string identifying the database type, e.g., "GeoIP2-City".
|
|
296
|
+
"""
|
|
324
297
|
|
|
325
|
-
|
|
298
|
+
description: Dict[str, str]
|
|
299
|
+
"""
|
|
300
|
+
A map from locales to text descriptions of the database.
|
|
301
|
+
"""
|
|
326
302
|
|
|
327
|
-
|
|
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
|
-
|
|
310
|
+
languages: List[str]
|
|
311
|
+
"""
|
|
312
|
+
A list of locale codes supported by the databse.
|
|
313
|
+
"""
|
|
330
314
|
|
|
331
|
-
|
|
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
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: maxminddb
|
|
3
|
-
Version: 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
|
|
@@ -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.
|
|
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
|
|
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
|
|
File without changes
|
{maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/bad-data/maxminddb-golang/cyclic-data-structure.mmdb
RENAMED
|
File without changes
|
{maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/bad-data/maxminddb-golang/invalid-bytes-length.mmdb
RENAMED
|
File without changes
|
|
File without changes
|
{maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/bad-data/maxminddb-golang/invalid-map-key-length.mmdb
RENAMED
|
File without changes
|
{maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/bad-data/maxminddb-golang/invalid-string-length.mmdb
RENAMED
|
File without changes
|
{maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/bad-data/maxminddb-golang/metadata-is-an-uint128.mmdb
RENAMED
|
File without changes
|
{maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/bad-data/maxminddb-golang/unexpected-bytes.mmdb
RENAMED
|
File without changes
|
{maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/bad-data/maxminddb-python/bad-unicode-in-map-key.mmdb
RENAMED
|
File without changes
|
|
File without changes
|
{maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/GeoIP2-City-Test-Broken-Double-Format.mmdb
RENAMED
|
File without changes
|
{maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/GeoIP2-City-Test-Invalid-Node-Count.mmdb
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/GeoIP2-Precision-Enterprise-Test.mmdb
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/MaxMind-DB-no-ipv4-search-tree.mmdb
RENAMED
|
File without changes
|
{maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/MaxMind-DB-string-value-entries.mmdb
RENAMED
|
File without changes
|
{maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/MaxMind-DB-test-broken-pointers-24.mmdb
RENAMED
|
File without changes
|
{maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/MaxMind-DB-test-broken-search-tree-24.mmdb
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/MaxMind-DB-test-metadata-pointers.mmdb
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{maxminddb-2.5.2 → maxminddb-2.6.1}/tests/data/test-data/MaxMind-DB-test-pointer-decoder.mmdb
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|