Skip to main content

Python IP Query.

Project description

Python: IP Query

PyPi Version

IP Query, allow proxy.

Installation

$ pip3 install ip-query

Usage

from ip_query import ip_query

ip = ip_query()

you will get the result like this:

{
    'ip': '112.118.6.224',
    'country': 'Hong Kong',
    'country_code': 'HK',
    'asn': 4760,
    'aso': 'HKT Limited'
}

Behind a socks5 proxy? use like this:

from ip_query import ip_query

ip = ip_query(
    requests_proxies={
        'http': 'socks5://127.0.0.1:1080',
        'https': 'socks5://127.0.0.1:1080',
    },
)

Thanks

We've chosen GeoLite2 Country and GeoLite2 ASN from GeoLite2 Free Downloadable Databases..

Latest Version: 20190122.

Many thanks to MaxMind.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ip-query-3.2.0.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ip_query-3.2.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file ip-query-3.2.0.tar.gz.

File metadata

  • Download URL: ip-query-3.2.0.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.7.2

File hashes

Hashes for ip-query-3.2.0.tar.gz
Algorithm Hash digest
SHA256 0bfa76868fadb904387a5c1e1f66c1a28003bebd90a015fdcc6bec8ef9ff4780
MD5 5c0793997fe694980c34f2bdefc9b307
BLAKE2b-256 f2d6aa87616a71998df844d0f876a712f1b0572d4ff69e4396ff0c390e7e1746

See more details on using hashes here.

File details

Details for the file ip_query-3.2.0-py3-none-any.whl.

File metadata

  • Download URL: ip_query-3.2.0-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.7.2

File hashes

Hashes for ip_query-3.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 419406346ddf59eaba70ae3107f57b281f67ed6229a734a863e479abd6e04c30
MD5 2283cc7ba447dd605473de0334ca6b48
BLAKE2b-256 fe1a4dc9391b6327db5f7a7bc234a04226498432485d273233d12debc410d7da

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page