Skip to main content

一个可以获取ip地址的Python库

Project description

介绍

这是一个Python库,它可以查看当前的IP地址

获取iPv4地址

import cniptest
print(cniptest.ip())

获取ipv6地址

import cniptest
print(cniptest.ipv6())

检测是否有ipv6,如果有那么就返回ipv6,如果没有就返回iPv4

import cniptest
print(cniptest.test())

获取北京出口ipv4地址

import cniptest
print(cniptest.bjv4())

获取北京出口ipv6地址

import cniptest
print(cniptest.bjv6())

获取南京出口ipv4地址

import cniptest
print(cniptest.njv6())

获取南京出口ipv4地址

import cniptest
print(cniptest.njv6())

FAQ

问:为什么返回Error? 答:一般是因为没有连接网络,少数情况没有ipv6地址或者没有ipv4地址(没有ipv4的概率极少,除非是故意在路由器关闭ipv4),极少数情况是服务器故障(这种情况下一般一会儿就可以解决,不过有可能是因为API关闭,这种情况下建议更新本库,我在API关闭后会第一时间更新本库的)

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

cniptest-3.0.2.tar.gz (2.1 kB view details)

Uploaded Source

File details

Details for the file cniptest-3.0.2.tar.gz.

File metadata

  • Download URL: cniptest-3.0.2.tar.gz
  • Upload date:
  • Size: 2.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for cniptest-3.0.2.tar.gz
Algorithm Hash digest
SHA256 1da6fc9675e060ef1a4bdbf25951abd7c8df395d667623074e1466e527b47fe8
MD5 cd083a59570f51bcbc76dcdd4be183d0
BLAKE2b-256 d624731ddc4b32388c5d0df0ff43332b14380d74bd87dc44b9dfdf122d6093a1

See more details on using hashes here.

Supported by

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