A model for get ipv4&ipv6 address
Project description
Thank you for supporting!
-
Function get_ip() is used to get your ipv4 address including host and port.
from ipv4v6 import get_ip print(get_ip()) #It'll print something like 117.143.170.80:2653
-
Function get_ipv4() is used to get your ipv4 address including only host.
from ipv4v6 import get_ipv4 print(get_ipv4()) #It'll print something like 117.143.170.80
(Tips : If you just want to get ipv4 address, get_ip() is a better choice because it's faster than get_ipv4)
-
Function get_ipv6() is used to get your ipv6 address including only host.
from ipv4v6 import get_ipv6 print(get_ipv6()) #It'll print something like 2409:8a1e:6e81:4280:6456:3051:4f3f:1965
-
Function ip_tuple() returns a tuple which contains the host and the port of your ipv4 address.
(Tips : It can be given to socket.connect() as parameter)
from socket import * from ipv4v6 import ip_tuple sock=socket(AF_INET,SOCK_STREAM) sock.connect(ip_tuple())
-
Function get_ipv4_location() and get_ipv6_location returns the location of your ip address.
from ipv4v6 import get_ipv4_location print(get_ipv4_location()) #It'll print the location
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file ipv4v6-1.1.0.tar.gz
.
File metadata
- Download URL: ipv4v6-1.1.0.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 12a1aed19850ef9463493eb65d44789d197add11250a2a1ff5835f1bcc2c2159 |
|
MD5 | 8e8e6f9fb59ba41c352ab431875c9fe8 |
|
BLAKE2b-256 | 39c289502e30e7cd91bf23de1f8be774a0dad0eb38c3d27aa119d7775c3c3e67 |