John Gorman's aioipinfo is a simple, async ipinfo.io client written in Python

:link: github.com/gormaniac/aioipinfo

To install run,

pip install aioipinfo==0.1.1
  • Comes with CLI feature
  • Provides free tier-level IP geolocation data
  • Parses geographic coordinate and ASN field

https://gormo.co/aioipinfo/

Our official Python library comes with async support as well (doc):

>>> import ipinfo
>>> access_token = '123456789abc'
>>> handler = ipinfo.getHandlerAsync(access_token)
>>> ip_address = '216.239.36.21'
>>> async def do_req():
...     details = await handler.getDetails(ip_address)
...     print(details.city)
...     print(details.loc)
...
>>>
>>> import asyncio
>>> loop = asyncio.get_event_loop()
>>> loop.run_until_complete(do_req())
Mountain View
37.4056,-122.0775
>>>
>>> ip_address = '1.1.1.1'
>>> loop.run_until_complete(do_req())
New York City
40.7143,-74.0060

:link: GitHub - ipinfo/python: Official Python Library for IPinfo API (IP geolocation and other types of IP data)

pip install ipinfo

It natively supports bulk data enrichment through the API.

Also, like always, check our CLI: GitHub - ipinfo/cli: Official Command Line Interface for the IPinfo API (IP geolocation and other types of IP data)