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 usepipto 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 and create an instance::
from FindMyIP import FindMyIP ip_finder = FindMyIP()
-
Check Internet Connection Status: To determine if your internet is connected or disconnected, use the
internet()method:>>> print(ip_finder.internet()) # Output: # 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()method:>>> local_ip = ip_finder.internal() >>> print(local_ip) # Output: 192.168.1.102 (Example value)
-
Retrieve External IP Address: To get your external IP address, use the
external()method:>>> real_ip = ip_finder.external() >>> print(real_ip) # Output: # 82.212.251.142 # When connected to the internet # None # When not connected to the internet
Logging:
Find My IP uses logging to provide useful debugging information. If an error occurs (e.g., no internet connection), it will be logged automatically.
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
internetfunction.
- Addressed a false positive issue in the
- Improved code documentation
- Added more comments to enhance code readability and understanding.
- Minor bug fixed
-
- Recoding as a class
- Improve error handling
- Get errors as log
Stay tuned for more updates as we continue to enhance Find My IP to meet your needs!
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file findmyip-2.0.1.tar.gz.
File metadata
- Download URL: findmyip-2.0.1.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cb1d93eb96e067a6002655374d6ac0b9d1c7a661ff76009d202e47b748eaf8e6
|
|
| MD5 |
44fd70f8c15847c25e22b098e5f95670
|
|
| BLAKE2b-256 |
992f1aa0cb916405b96b360ad3b997c55718ef2c981e2c264a734ad8a69e7674
|
File details
Details for the file findmyip-2.0.1-py3-none-any.whl.
File metadata
- Download URL: findmyip-2.0.1-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b193676c0b4d2c9533d44efcee1f25a5113beb87fb9e9e5f6b8a3c19f76121c4
|
|
| MD5 |
93f03321db5e12a36f3c92ac8abc199a
|
|
| BLAKE2b-256 |
cb40e6fafc316408d5f3e865c9a4c67728423513d51513ff0edfb7f295b835f8
|