No project description provided
Project description
simplesubnet
by Brody Tingle
This is a simple, lightweight tool that can be used to help with subnetting.
I created this while studying for my CCNA to help with problems and gain a deeper understanding
of subnetting.
To install, run:
pip3 install simplesubnet
To import, include this in your header:
from simplesubnet import subnet
FUNCTIONS:
Binary IP to Decimal IP Converter:
subnet.binary_to_ip(address):
returns a string representing the decimal IP address
Decimal IP to Binary IP Converter:
subnet.ip_to_binary(address):
returns a string representing the decimal IP address
Calculate proper subnet mask based on amount of hosts needed:
subnet.subnet_mask(num_hosts):
returns the subnet mask as an INTEGER (i.e /30 => 30)
Calculate Network and Broadcast Address given an address and a number of needed hosts:
subnet.addresses(starting_address, hosts):
returns a dictionary containing values:
['network'] = network address
['broadcast'] = broadcast address
Calculate Network and Broadcast Addresses for a network with
multiple LAN's provided # of hosts per LAN. Uses VLSM to calculate.
subnet.network_addresses(starting_address, hosts):
hosts is a dictionary containing the # of hosts per VLAN:
ex. {1: 64, 2: 45, 3: 14: 4: 9}
returns a dictionary of dictionaries from the {addresses} method
keys are VLAN #'s
ex:
{1: {'network': 192.168.5.0/25, 'broadcast': 192.168.5.127/25},
2: {'network': 192.168.5.128/26, 'broadcast': 192.168.5.191/26}}
Summary Function:
subnet.summary(address_book):
address_book is a dictionary returned from the {network_addresses} function
prints the dictionary in clean formatting
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
simplesubnet-0.1.3.tar.gz
(4.1 kB
view details)
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 simplesubnet-0.1.3.tar.gz.
File metadata
- Download URL: simplesubnet-0.1.3.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.12.1 Darwin/23.2.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd74ab58b9307eac397ecd70875ede8e033d2edaf978c925689d90096ced5c65
|
|
| MD5 |
d56badae05d50d0e0e85b1a2716ee03a
|
|
| BLAKE2b-256 |
2f7cb362d0e9ad3d9cdca30dde3796c32df1bfb77971cc211afbc8b2e0af8e83
|
File details
Details for the file simplesubnet-0.1.3-py3-none-any.whl.
File metadata
- Download URL: simplesubnet-0.1.3-py3-none-any.whl
- Upload date:
- Size: 2.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.12.1 Darwin/23.2.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0ab8e01d0e1d4bbd46a11478f6e17d0a0850028da9c51860a554a7004fdc64a9
|
|
| MD5 |
44852e7bc6203cf657f247f06191afec
|
|
| BLAKE2b-256 |
a3ba93cebd56f48b7d8b35de867339c06a74ed8ec874345f5dcc032fa3d7e64b
|