-
Notifications
You must be signed in to change notification settings - Fork 143
Closed
Description
It would be more Pythonic if you guys support Python's context manager for geoip2.database.Reader, so that we can call:
with geoip2.database.Reader('GeoLite2-City.mmdb') as reader:
r = reader.city(ip_addr)
data = {
'country_code': r.country.iso_code,
'country_name': r.country.name
}and reader.close() is called automatically when exiting with.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels