Skip to main content

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: 20190312.

Many thanks to MaxMind.

Metadata

Release files for ip-query 4.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ip-query 4.3.1
File Size Uploaded Provenance
ip-query-4.3.1.tar.gz 5.5 MB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for ip-query 4.3.1
File Interpreter ABI Platform
ip_query-4.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 11.1 MB

Release files / ip-query-4.3.1.tar.gz

Download URL ip-query-4.3.1.tar.gz
Size 5.5 MB
Tags Source
SHA-256 checksum
How to use checksums
08eb381a8bb4c4b445259fc28ed337354eb2b793b7d1d762237d8506a15ad543
BLAKE2b-256 checksum
How to use checksums
01c2c8aa8fd6484ada15cb765165222b7d1b349fd3d37c14c7d0179329b3674b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

Release files / ip_query-4.3.1-py3-none-any.whl

Download URL ip_query-4.3.1-py3-none-any.whl
Size 5.6 MB
Tags Python 3
SHA-256 checksum
How to use checksums
db418af680a97dccf801485d05ab86aa0c2d76a3bfbb330b92738ad6e7b1d3c6
BLAKE2b-256 checksum
How to use checksums
a40d8a014d4d11a30cb460c0817c2af74eff3ef22bacaefcdbb9e78cf1091928
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

Security for ip-query 4.3.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page