How to convert the class GeoIP data in JSON?

Need from the database https://dev.maxmind.com/ to get the full JSON data.

Now it looks like this:

reader = geoip2.database.Reader(str(DBFullPath), "r")
response = reader.country(tempIP)
print(response)

I get on the console something like this:
geoip2.models.Country({'traits': {'ip_address': '8.35.60.229'}, u 'country': {u 'geoname_id': 6252001, u 'iso_code': u 'US', u 'names': {u 'EN': u'\u0421\u0428\u0410', u 'fr': u'\xc9tats-Unis', u'en': u 'United States', u 'de': u 'USA', u 'zh-CN': u'\u7f8e\u56fd', u pt-BR': u 'Estados Unidos', u 'ja': u'\u30a2\u30e1\u30ea\u30ab\u5408\u8846\u56fd', u 'es': u 'Estados Unidos'}}, u 'continent': {u 'geoname_id': 6255149, u 'code': u 'NA', u 'names': {u 'EN': u'\u0421\u0435\u0432\u0435\u0440\u043d\u0430\u044f \u0410\u043c\u0435\u0440\u0438\u043a\u0430', u 'fr': u Am\xe9rique du Nord', u'en': u 'North America', u 'de': u 'Nordamerika', u 'zh-CN': u'\u5317\u7f8e\u6d32', u 'pt-BR': u Am\xe9rica do Norte', u 'ja': u'\u5317\u30a2\u30e1\u30ea\u30ab', u 'es': u Norteam\xe9rica'}}, u registered_country': {u 'geoname_id': 6252001, u 'iso_code': u 'US', u 'names': {u 'EN': u'\u0421\u0428\u0410', u 'fr': u'\xc9tats-Unis', u'en': u 'United States', u 'de': u 'USA', u 'zh-CN': u'\u7f8e\u56fd', u 'pt-BR': u 'Estados Unidos', u 'ja': u'\u30a2\u30e1\u30ea\u30ab\u5408\u8846\u56fd', u 'es': u 'Estados Unidos'}}}, r)


This is very similar to JSON. But it's not. How do I get the full JSOn?
June 14th 19 at 20:20
1 answer
June 14th 19 at 20:22
json.dumps
json.loads
You offer stampit object in JSON? He's not the right work.

I tried to do so: `response = vars(reader.country(tempIP))`.

Here is what I got paste.code123.org/547489a1-c931 - paula.Ste commented on June 14th 19 at 20:25

Find more questions by tags GeoIPPython