Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add IPinfo #2559

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add IPinfo #2559

wants to merge 1 commit into from

Conversation

abdullahdevrel
Copy link

What is this Python project?

This is the official IPinfo's Python library and provides IP to Geolocation data. The library is awesome because:

  • It provides easy access to IPinfo's API services such as IP to Geolocation data, ASN, privacy detection etc.
  • It even supports tokenless access to the API (1,000 req/month)
  • It supports bulk IP enrichment
  • Has native support for caching
  • Support async operation

Code example:

import ipinfo
handler = ipinfo.getHandler()
ip = "149.74.80.31"
details = handler.getDetails(ip)

print(details.all)

Output

{
  "ip": "149.74.80.31",
  "hostname": "31.pool149-74-80.dynamic.orange.es",
  "city": "Sant Mart\u00ed",
  "region": "Catalonia",
  "country": "ES",
  "loc": "41.4181,2.1993",
  "org": "AS12479 Orange Espagne SA",
  "postal": "08018",
  "timezone": "Europe/Madrid",
  "readme": "https://ipinfo.io/missingauth",
  "country_name": "Spain",
  "isEU": true,
  "country_flag_url": "https://cdn.ipinfo.io/static/images/countries-flags/ES.svg",
  "country_flag": {
    "emoji": "\ud83c\uddea\ud83c\uddf8",
    "unicode": "U+1F1EA U+1F1F8"
  },
  "country_currency": {
    "code": "EUR",
    "symbol": "\u20ac"
  },
  "continent": {
    "code": "EU",
    "name": "Europe"
  },
  "latitude": "41.4181",
  "longitude": "2.1993"
}

What's the difference between this Python project and similar ones?

As the library is officially built on top of IPinfo's API service, it is hard to distinguish this Python project from similar ones. However, there are additional advantages to using the library instead of accessing the API directly:

  • The library has built-in support for native bulk operations, allowing for efficient enrichment of IP metadata on a large scale without the need for sequential API calls.
  • The API does not provide country-specific information.
  • The library handles asynchronous operations internally.
  • Both Python and this library offer caching support, which is not available at the API level.

--

Anyone who agrees with this pull request could submit an Approve review to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants