Skip to content
/ ip_man Public

IP utils for network management, subnetting and more...

License

Notifications You must be signed in to change notification settings

thamnis/ip_man

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IP Manager

en fr

MIT License Python 3.13 Repo Size Issues Pull Requests Contributors Last Commit

📌 Overview

IP Manager is a Python library that provides advanced operations on IP addresses:

  • Validation of IP addresses and CIDR.
  • 🔄 Conversion between binary and decimal notation.
  • 🛠 Subnet mask calculation.
  • 📍 Network address range determination.
  • 🚀 Network optimization for a given number of hosts.

🚀 Installation

Make sure you have Python 3.x installed on your machine, then clone the repository:

git clone https://github.com/thamnis/ip_manager.git
cd ip_manager

📖 Usage

Example usage of the Ip class:

from ip_manager import Ip

# Creating an instance with an IP address

ip_instance = Ip("192.168.1.0/24")

print(f"IP Address: {ip_instance.ip}")
print(f"CIDR: {ip_instance.cidr}")
print(f"Decimal Mask: {ip_instance.mask_dec}")
print(f"Address Range: {ip_instance.ip_range}")

Run an example:

python main.py

🌍 Network Optimization

If you want to optimize your network for a given number of hosts:

optimized_network = ip_instance.optimize_network(50)
print(optimized_network)

🛠 Dependencies

No external dependencies are required. The script works with Python's standard modules.

🧪 Unit Tests

A test file test.py is available to validate the functionalities.

🔹 Running tests

python -m unittest test.py

📜 License

This project is licensed under the MIT License. See the LICENSE file for more details.

✨ Author

Developed by @thamnis.

About

IP utils for network management, subnetting and more...

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages