A command-line tool to classify IPv4 addresses by class, scope (public/private), and validity.
This Python CLI analyzes a user-entered IPv4 address and returns its class (A–E), whether it's public, private, loopback, or invalid. It’s designed for students or IT learners who want to reinforce their understanding of networking fundamentals.
pipx install ip-address-classifier
⚠️ Ifipclassisn’t recognized after install, run:
pipx ensurepath
exec $SHELL # or restart your terminalgit clone https://github.com/YOUR_USERNAME/ip-address-classifier.git
cd ip-address-classifier
python ip_address_classifier.pyipclassFollow the prompt in the terminal:
- Enter an IPv4 address in the format
X.X.X.X(e.g.,192.168.1.1) - The program will tell you:
- If it’s a valid address
- Its class (A–E)
- Whether it is public, private, or a loopback address
Example:
Enter address here: 10.0.0.1
10.0.0.1 is a class A private address.
- Python 3.12+
- Poetry for packaging
- No external dependencies
- Add CIDR block validation
- Accept multiple addresses from a file
- Refactor with regex and OOP structure
- Fork the project
- Create a feature branch (
git checkout -b feature/my-feature) - Commit your changes (
git commit -m 'Add feature') - Push to your branch (
git push origin feature/my-feature) - Open a Pull Request
Created by David Griffin
This project is licensed under the MIT License.