Skip to main content

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.2.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

simplesubnet-0.1.2-py3-none-any.whl (2.6 kB view details)

Uploaded Python 3

File details

Details for the file simplesubnet-0.1.2.tar.gz.

File metadata

  • Download URL: simplesubnet-0.1.2.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

Hashes for simplesubnet-0.1.2.tar.gz
Algorithm Hash digest
SHA256 39714fe99d28bb584d9be8316ea50013ffdb8be482170fe5ed5e909ed0e51cf7
MD5 660ebb8cfeb9b5c743a0201354f792e6
BLAKE2b-256 1633ac89c7f97d8f6d3847c1d462d215671f2ece94380e57a3468bdb2e119a43

See more details on using hashes here.

File details

Details for the file simplesubnet-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: simplesubnet-0.1.2-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

Hashes for simplesubnet-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e34280e0510eb632ac0ed6f7373805a4b405219506fbfeaff98eae71b9413700
MD5 50afd3b50dbb2c62ef0aedc3cdfaed77
BLAKE2b-256 ed8511c60b4e54664ff330d9d25820a130b15ad60a9d54aba6fc0244c776a93f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page