Skip to main content

yzhanURLParser

A python library which could parse URL to ip and country.

Usage

Install

pip install yzhanurlparser

API

Is IP

from yzhanurlparser import is_ip
is_ip('123') # False
is_ip('8.8.8.8') # True

Get Info By IP

from yzhanurlparser import get_info_by_ip
get_info_by_ip('8.8.8.8')
# {'ip': '8.8.8.8', 'country_short': 'US', 'country_long': 'United States of America'}

Get Country By IP

from yzhanurlparser import get_country_by_ip
get_country_by_ip('8.8.8.8') # US
get_country_by_ip('114.114.114.114') # CN

Get Info By URL

from yzhanurlparser import get_info_by_url
get_info_by_url('https://www.163.com')
# {'ip': '183.3.203.247', 'country_short': 'CN', 'country_long': 'China'}

Get Country By URL

from yzhanurlparser import get_country_by_url
get_country_by_url('https://www.163.com') # CN

Development

Install

pip install -r requirements.txt

Unit Test

cd yzhanurlparser
python -m unittest discover -s test -p '*_test.py'

Build

pip install --user --upgrade setuptools wheel twine # First Run
python setup.py sdist bdist_wheel

Thanks

ip2location

Metadata

Release files for yzhanurlparser 0.1.0

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

Source distribution (sdist)

Source distribution for yzhanurlparser 0.1.0
File Size Uploaded Provenance Actions
yzhanurlparser-0.1.0.tar.gz 716.9 kB Without provenance Details for yzhanurlparser-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for yzhanurlparser 0.1.0
File Interpreter ABI Platform Actions
yzhanurlparser-0.1.0-py3-none-any.whl Python 3 none any Details for yzhanurlparser-0.1.0-py3-none-any.whl

Total release size: 1.4 MB

Release files / yzhanurlparser-0.1.0.tar.gz

Download URL yzhanurlparser-0.1.0.tar.gz
Size 716.9 kB
Tags Source
SHA-256 checksum
How to use checksums
3205f132041a7f2fdf3e72250317ca11da0259f92d442935ce93d5fa0db893b1
BLAKE2b-256 checksum
How to use checksums
6574eabe3bda53d4ca030de6bc50183197b8cdde2121e3ed8d27560cf4f50a19
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.3

Release files / yzhanurlparser-0.1.0-py3-none-any.whl

Download URL yzhanurlparser-0.1.0-py3-none-any.whl
Size 715.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
697f6f19d4cd729234635d04052b49b3fe430706c96588ac30f990e928b66830
BLAKE2b-256 checksum
How to use checksums
1cb467be1d3ab5f4e3f00ced4d3ea9a7ed4131ce5099dc33ac9fbfc5b795ac0c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.3

Security for yzhanurlparser 0.1.0

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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