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.5.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.5-py3-none-any.whl (2.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: simplesubnet-0.1.5.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.5.tar.gz
Algorithm Hash digest
SHA256 1ba38ad71e82a899c60abc958d8c5352b33c72db63d2ff043bf5ea81ad39ba9c
MD5 f5899be821c51cd6408404a62f0de601
BLAKE2b-256 4df43018df16cae75fc938d4e0f9b5ce1f24304645030d123d52e17c0a35a69d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: simplesubnet-0.1.5-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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 023c5b0fee7791094d50caa906b5d6e34706b9e8d43298e6af96b10cbefc3f2e
MD5 e2701b310daf9d7f6cc96016da6cd26e
BLAKE2b-256 179f99253528d2125efe1e1f54a55c5ba6e321104f7a869e6a78cfd998c08719

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