Releases: maxmind/MaxMind-DB-Reader-python
Releases · maxmind/MaxMind-DB-Reader-python
1.5.0
- 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
and
ipaddress.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.
1.4.1
1.4.0
- 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 newmaxminddb.Reader
object usingMODE_FD
.
This will read the database from the file descriptor into memory. Pull
request by nkinkade. GitHub #33.
1.3.0
1.2.3
1.2.2
1.2.1: Use ipaddress instead of ipaddr on Python 2. Packaging fixes.
- This module now uses the
ipaddress
module for Python 2 rather than the
ipaddr
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.
1.2.0: MODE_FILE fix when reader is loaded before forking
- 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.
1.1.1: Python 3 MODE_AUTO fix
- On Python 3 there was a potential issue where
open_database
with
MODE_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.
1.1.0: Memory and file more for Python reader
- 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
themmap
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 read
mode
. - The C extension no longer creates its own
InvalidDatabaseError
class
and instead uses the one defined inmaxminddb.errors
.