- The vendored
libmaxminddb
has been updated to 1.10.0. This fixes a bug that would cause incorrect results on databases that had search trees greater than 4 GB.
- This release includes no source code changes. The only changes are to the release workflow.
- Binary wheels are now built on Linux for aarch64. Pull request by Kevin Park. GitHub #160.
- Binary wheels are now built on macOS for Apple silicon. Requested by Kevin Park. GitHub #152.
- Added type annotations for instance variables on
Metadata
- Updated type stubs for
maxminddb.extension
. setuptools
is no longer listed as a runtime dependency. Pull request by Lewis Collard. GitHub #155.
- The vendored
libmaxminddb
version was updated to 1.9.0. This fixes an issue when reading databases with a search tree exceeding 2 GB. Reported by Sami Salonen. GitHub #146.
- This is a re-release of 2.5.0 to address missing files from the sdist. Reported by Lumír 'Frenzy' Balhar. GitHub #132.
- IMPORTANT: Python 3.8 or greater is required. If you are using an older version, please use an earlier release.
- Windows is now supported by the C extension.
- The
Reader
class now implements the__iter__
method. This will return an iterator that iterates over all records in the database, excluding repeated aliased of the IPv4 network. Requested by Jean-Baptiste Braun and others. GitHub #23. - The multiprocessing test now explicitly uses
fork
. This allows it to run successfully on macOS. Pull request by Theodore Ni. GitHub #116. - A vendored copy of
libmaxminddb
will now be used by default when building the extension. If you wish to continue using the system shared library, you may set theMAXMINDDB_USE_SYSTEM_LIBMAXMINDDB
environment variable to a true value when building the extension. - The C extension now builds on Python 3.13.
- The C extension will now be built for PyPy.
- Package metadata was migrated from
setup.py
tosetup.cfg
. GitHub #113. - The C extension now decrements the reference count on an object containing the database filename after its use in an error message rather than before. Pull request by Lumír 'Frenzy' Balhar. GitHub #114.
- IMPORTANT: Python 3.7 or greater is required. If you are using an older version, please use an earlier release.
distutils
is no longer used for building the C extension.- Missing
Py_INCREF
was added to module initialization for the C extension. Pull request by R. Christian McDonald. GitHub #106.
- The return type for
maxminddb.open_database()
has been simplified to be just theReader
class as opposed to a union of that with the extension class. This is done by casting the extension toReader
. The extension class has the same public API as the pure Python implementation. This simplifies type checking for users of this library. TheReader
class is exposed asmaxminddb.Reader
. Pull request by wouter bolsterlee. GitHub #88. maxminddb.__all__
is now set to define a public API. Pull request by wouter bolsterlee. GitHub #88.- Fix minor regression in
repr
output ofmaxminddb.reader.Metadata
in 2.1.0.
- The C extension now correctly supports objects that implement the
os.PathLike
interface. - When opening a database fails due to an access issue, the correct
OSError
subclass will now be thrown. - The
Metadata
class object is now available from the C extension module asmaxminddb.extension.Metadata
rather thanmaxminddb.extension.extension
. - Type stubs have been added for
maxminddb.extension
.
- The 2.0.0 release unintentionally required Python to be compiled with
mmap
support for the module to work.mmap
is now optional again. Reported by john-heasman-cg. GitHub #76.
- Added
py.typed
file per PEP 561. Reported by Árni Már Jónsson.
- Fix minimum required python version in
setup.py
. Pull request by Boros Gábor. GitHub #69 & #70.
- IMPORTANT: Python 3.6 or greater is required. If you are using an older version, please use a 1.x.x release.
- Type hints have been added.
- 1.5.3 was missing a test database. This release adds the test file. There are no other changes. Reported by Lumír 'Frenzy' Balhar. GitHub #60.
- Fix a segfault when decoding a database with a corrupt data section. Reported by Robert Scott. GitHub #58.
- Minor performance improvements in the pure Python reader.
- Fix a possible segfault due to not correctly incrementing the reference on a returned object.
- Python 3.3 and 3.4 are no longer supported.
- The extension source directory was moved to prevent an
ImportWarning
when importing the module on Python 2 with-Wdefault
set. Reported by David Szotten and Craig de Stigter. GitHub #31. - The
get
method now acceptsipaddress.IPv4Address
andipaddress.IPv6Address
objects in addition to strings. This works with both the pure Python implementation as well as the extension. Based on a pull request #48 by Eric Pruitt. GitHub #50. - A new method,
get_with_prefix_len
, was added. This method returns a tuple containing the record and the prefix length.
- Fix test failure on Python 3.7. Reported by Carl George. GitHub #35.
- IMPORTANT: Previously, the pure Python reader would allow
ipaddress.IPv4Address
andipaddress.IPv6Address
objects when calling.get()
. This would fail with the C extension. The fact that these objects worked at all was an implementation detail and has varied with different releases. This release makes the pure Python implementation consistent with the extension. ATypeError
will now be thrown if you attempt to use these types with either the pure Python implementation or the extension. The IP address passed to.get()
should be a string type. - Fix issue where incorrect size was used when unpacking some types with the pure Python reader. Reported by Lee Symes. GitHub #30.
- You may now pass in the database via a file descriptor rather than a file
name when creating a new
maxminddb.Reader
object usingMODE_FD
. This will read the database from the file descriptor into memory. Pull request by nkinkade. GitHub #33.
maxminddb.Reader
and the C extension now support being used in a context manager. Pull request by Joakim Uddholm. GitHub #21 & #28.- Provide a more useful error message when
MODE_MMAP_EXT
is requested but the C extension is not available.
- Improve compatibility with other Python 2
ipaddress
backports. Althoughipaddress
is highly recommended,py2-ipaddress
andbackport_ipaddress
should now work. Incompatibility reported by John Zadroga ongeoip2
GitHub issue #41.
- Fix to the classifiers in
setup.py
. No code changes.
- This module now uses the
ipaddress
module for Python 2 rather than theipaddr
module. Users should notice no behavior change beyond the change in dependencies. - Removed
requirements.txt
fromMANIFEST.in
in order to stop warning during installation. - Added missing test data.
- Previously if
MODE_FILE
was used and the database was loaded before forking, the parent and children would use the same file table entry without locking causing errors reading the database due to the offset being changed by other processes. InMODE_FILE
, the reader will now useos.pread
when available and a lock whenos.pread
is not available (e.g., Python 2). If you are usingMODE_FILE
on a Python withoutos.pread
, it is recommended that you open the database after forking to reduce resource contention. - The
Metadata
class now overloads__repr__
to provide a useful representation of the contents when debugging. - An
InvalidDatabaseError
will now be thrown if the data type read from the database is invalid. Previously aKeyError
was thrown.
- On Python 3 there was a potential issue where
open_database
withMODE_AUTO
would try to use the C extension when it was not available. This could cause the function to fail rather than falling back to a pure Python mode.
- The pure Python reader now supports an optional file and memory mode in
addition to the existing memory-map mode. If your Python does not provide
the
mmap
module, the file mode will be used by default. - The preferred method for opening a database is now the
open_database
function inmaxminddb
. This function now takes an optional readmode
. - The C extension no longer creates its own
InvalidDatabaseError
class and instead uses the one defined inmaxminddb.errors
.
First production release.
Two potential C extension issues discovered by Coverity were fixed: - There was a small resource leak that occurred when the system ran out of
memory.
- There was a theoretical null pointer issue that would occur only if libmaxminddb returned invalid data.
- Corrected initialization of objects in C extension and made the objects behave more similarly to their pure Python counterparts.
- Switched to Apache 2.0 license.
- We now open the database file in read-only mode.
- Minor code clean-up.
- Fixed packaging problem that caused
import
to fail.
- This release includes a pure Python implementation of the database reader.
If
libmaxminddb
is not available or there are compilation issues, the module will fall-back to the pure Python implementation. - Minor changes were made to the exceptions of the C extension make them consistent with the pure Python implementation.
- Removed -Werror compiler flag as it was causing problems for some OS X users.
- Refactored code and fixed a memory leak when throwing an exception.
- Added MANIFEST.in
- Initial release