Find your IP address (both internal and external) or check your connection state.
Project description
Find My IP
Find My IP is a user-friendly Python package that helps you find both your internal (local) and external IP addresses. It also lets you check your internet connection status effortlessly. By importing FindMyIP into your script, you can easily retrieve your IP addresses and quickly determine if your internet is connected. It's a simple and convenient tool for developers to use in their projects.
Installing
To get started with Find My IP, you have two options for installation:
-
Download from GitHub: You can download the module directly from the GitHub repository.
-
Install with
pip
: Alternatively, you can usepip
to install the package effortlessly. Open your terminal or command prompt and run the following command:
pip install FindMyIP
With just a simple installation step, you'll be ready to utilize Find My IP in your Python projects!
How to use
Using Find My IP is straightforward. Here's a step-by-step guide to help you get started:
-
Import the module:
import FindMyIP as ip
-
Check Internet Connection Status: To determine if your internet is connected or disconnected, use the
internet()
function:>>> ip.internet() True # If the internet is connected. False # If the internet is disconnected.
-
Retrieve Local IP Address: To find your local (internal) IP address, use the
internal()
function:>>> local_ip = ip.internal() >>> print(local_ip) 192.168.1.102
-
Retrieve External IP Address: To get your external IP address, use the
external()
function:>>> real_ip = ip.external() >>> print(real_ip) 82.212.251.142 None # When you are not connected to the internet
With these simple steps, you can easily find your IP addresses and check your internet connection status using the Find My IP package in your Python projects. Happy coding!
Change Log:
We're continuously improving Find My IP to ensure the best experience. Here's a summary of the recent updates:
-
- Initial Release
-
- Minor bug fixed
- Addressed a false positive issue in the
internet
function.
- Addressed a false positive issue in the
- Improved code documentation
- Added more comments to enhance code readability and understanding.
- Minor bug fixed
Stay tuned for more updates as we continue to enhance Find My IP to meet your needs!
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.