setuptools
was incorrectly listed as a runtime dependency. This has been removed. Pull request by Mathieu Dupuy. GitHub #174.
- IMPORTANT: Python 3.8 or greater is required. If you are using an older version, please use an earlier release.
- The
is_anycast
attribute was added togeoip2.record.Traits
. This returnsTrue
if the IP address belongs to an anycast network. This is available for the GeoIP2 Country, City Plus, and Insights web services and the GeoIP2 Country, City, and Enterprise databases.
- IMPORTANT: Python 3.7 or greater is required. If you are using an older version, please use an earlier release.
- The
AddressNotFoundError
class now has anip_address
attribute with the lookup address andnetwork
property for the empty network in the database containing the IP address. These are only available when using a database, not the web service. Pull request by illes. GitHub #130.
- Support for mobile country code (MCC) and mobile network codes (MNC) was
added for the GeoIP2 ISP and Enterprise databases as well as the GeoIP2
City and Insights web services.
mobile_country_code
andmobile_network_code
attributes were added togeoip2.model.ISP
for the GeoIP2 ISP database andgeoip2.record.Traits
for the Enterprise database and the GeoIP2 City and Insights web services. We expect this data to be available by late January, 2022.
- The public API on
geoip2.database
is now explicitly defined by setting__all__
. - The return type of the
metadata()
method onReader
is nowmaxminddb.reader.Metadata
rather than a union type.
- Previously, the
py.typed
file was not being added to the source distribution. It is now explicitly specified in the manifest. - The type hints for the database file in the
Reader
constructor have been expanded to match those specified bymaxmindb.open_database
. In particular,os.PathLike
andIO
have been added. - Corrected the type hint for the
metadata()
method onReader
. It will return amaxminddb.extension.Metadata
if the C extension is being used.
- You may now set a proxy to use when making web service requests by passing
the
proxy
parameter to theAsyncClient
orClient
constructor.
- Added the
is_residential_proxy
attribute togeoip2.model.AnonymousIP
andgeoip2.record.Traits
. HTTPError
now provides the decoded response content in thedecoded_content
attribute. Requested by Oleg Serbokryl. GitHub #95.
- Added
py.typed
file per PEP 561. Reported by Árni Már Jónsson.
- Re-release to fix bad reStructuredText in
README.md
. No substantive changes.
- IMPORTANT: Python 2.7 and 3.5 support has been dropped. Python 3.6 or greater is required.
- Asyncio support has been added for web service requests. To make async
requests, use
geoip.webservice.AsyncClient
. geoip.webservice.Client
now provides aclose()
method and associated context managers to be used inwith
statements.- Type hints have been added.
- The attributes
postal_code
andpostal_confidence
have been removed fromgeoip2.record.Location
. These would previously always beNone
. user_id
is no longer supported as a named argument for the constructor ongeoip2.webservice.Client
. Useaccount_id
or a positional parameter instead.- For both
Client
andAsyncClient
requests, the default timeout is now 60 seconds.
- BREAKING CHANGE: The
geoip2.record.*
classes have been refactored to improve performance. This refactoring may break classes that inherit from them. The public API should otherwise be compatible. - The
network
attribute was added togeoip2.record.Traits
,geoip2.model.AnonymousIP
,geoip2.model.ASN
,geoip2.model.ConnectionType
,geoip2.model.Domain
, andgeoip2.model.ISP
. This is anipaddress.IPv4Network
or anipaddress.IPv6Network
. This is the largest network where all of the fields besidesip_address
have the same value. GitHub #79. - Python 3.3 and 3.4 are no longer supported.
- Updated documentation of anonymizer attributes -
is_anonymous_vpn
andis_hosting_provider
- to be more descriptive. - Added support for the
user_count
trait for the GeoIP2 Precision webservice. - Added the
static_ip_score
attribute togeoip2.record.Traits
for GeoIP2 Precision Insights. This is a float which indicates how static or dynamic an IP address is.
- You may now pass in the database via a file descriptor rather than a file
name when creating a new
geoip2.database.Reader
object usingMODE_FD
. This will read the database from the file descriptor into memory. Pull request by nkinkade. GitHub #53.
- Python 2.6 support has been dropped. Python 2.7+ or 3.3+ is now required.
- Renamed user ID to account ID in the code and added support for the new
ACCOUNT_ID_REQUIRED
ANDACCOUNT_ID_UNKNOWN
error codes.
- The
is_in_european_union
attribute was added togeoip2.record.Country
andgeoip2.record.RepresentedCountry
. This attribute isTrue
if the country is a member state of the European Union.
- The following new anonymizer attributes were added to
geoip2.record.Traits
for use with GeoIP2 Precision Insights:is_anonymous
,is_anonymous_vpn
,is_hosting_provider
,is_public_proxy
, andis_tor_exit_node
.
- Added support for GeoLite2 ASN database.
- Corrected documentation of errors raised when using the database reader. Reported by Radek Holý. GitHub #42.
- Recent releases of
requests
(2.12.2 and 2.12.3) require that the username for basic authentication be a string or bytes. The documentation for this module uses an integer for theuser_id
, which will break with theserequests
versions. Theuser_id
is now converted to bytes before being passed torequests
.
- Updated documentation to clarify what the accuracy radius refers to.
- Fixed classifiers in
setup.py
.
- This module now uses
ipaddress
on Python 2 rather thanipaddr
to validate IP addresses before sending them to the web service. - Added handling of additional error codes that the web service may return.
- PEP 257 documentation fixes.
- Updated documentation to reflect that the accuracy radius is now included in City.
- Previously, the source distribution was missing some tests and test databases. This has been corrected. Reported by Lumir Balhar.
- Added support for the GeoIP2 Enterprise database.
geoip2.database.Reader
now supports being used in awith
statement (PEP 343). (PR from Nguyễn Hồng Quân. GitHub #29)
- The
geoip2.records.Location
class has been updated to add attributes for theaverage_income
andpopulation_density
fields provided by the Insights web service. - The
is_anonymous_proxy
andis_satellite_provider
properties ongeoip2.records.Traits
have been deprecated. Please use our GeoIP2 Anonymous IP database to determine whether an IP address is used by an anonymizing service.
- The reader now supports pure Python file and memory modes. If you are not
using the C extension and your Python does not provide the
mmap
module, the file mode will be used by default. You can explicitly set the mode using themode
keyword argument with theMODE_AUTO
,MODE_MMAP
,MODE_MMAP_EXT
,MODE_FILE
, andMODE_MEMORY
constants exported bygeoip2.database
.
- Added support for the GeoIP2 Anonymous IP database. The
geoip2.database.Reader
class now has ananonymous_ip()
method which returns ageoip2.models.AnonymousIP
object. - Added
__repr__
and__eq__
methods to the model and record classes to aid in debugging and using the library from a REPL.
- The constructor for
geoip2.webservice.Client
now takes an optionaltimeout
parameter. (PR from arturro. GitHub #15)
- First production release.
BREAKING CHANGES: - The deprecated
city_isp_org()
andomni()
methodshave been removed.
- The
geoip2.database.Reader
lookup methods (e.g.,city()
,isp()
) now raise aTypeError
if they are used with a database that does not match the method. In particular, doing acity()
lookup on a GeoIP2 Country database will result in an error and vice versa.
- The
A
metadata()
method has been added to thegeoip2.database.Reader
class. This returns amaxminddb.reader.Metadata
object with information about the database.
- The web service client API has been updated for the v2.1 release of the web
service. In particular, the
city_isp_org
andomni
methods ongeoip2.webservice.Client
should be considered deprecated. Thecity
method now provides all of the data formerly provided bycity_isp_org
, and theomni
method has been replaced by theinsights
method. Note: In v2.1 of the web service,accuracy_radius
,autonomous_system_number
, and all of theconfidence
values were changed from unicode to integers. This may affect how you use these values from this API. - Support was added for the GeoIP2 Connection Type, Domain, and ISP databases.
- Switched to Apache 2.0 license.
- Fixed missing import statements for geoip2.errors and geoip2.models. (Gustavo J. A. M. Carneiro)
- Minor documentation and code cleanup
- Added requirement for maxminddb v0.3.0, which includes a pure Python
database reader. Removed the
extras_require
for maxminddb.
- Added missing geoip2.models import to geoip.database.
- Documentation updates.
- Read in
README.rst
as UTF-8 insetup.py
.
- API CHANGE: Changed the
languages
keyword argument tolocales
on the constructors forgeoip.webservice.Client
andgeoip.database.Reader
.
- Fixed packaging issue with extras_require.
- IMPORTANT:
geoip.webservices
was renamedgeoip.webservice
as it contains only one class. - Added GeoIP2 database reader using
maxminddb
. This does not work with PyPy as it relies on a C extension. - Added more specific exceptions for web service client.
- Fixed a bug in the model objects that prevented
longitude
andmetro_code
from being used.
- First official beta release.
- Documentation updates and corrections.
- Support for Python 3.2 was dropped.
- The methods to call the web service on the
Client
object now validate the IP addresses before calling the web service. This requires theipaddr
module on Python 2.x. - We now support more languages. The new languages are de, es, fr, and pt-BR.
- The REST API now returns a record with data about your account. There is a new geoip.records.MaxMind class for this data.
- Rename model.continent.continent_code to model.continent.code.
- Documentation updates.
- Documentation and packaging updates
- Initial release