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

Uploaded Python 3

File details

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

File metadata

  • Download URL: simplesubnet-0.1.4.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.4.tar.gz
Algorithm Hash digest
SHA256 bb25f3b7bd5d53009c7af272bc09d7010e224c1b21fbadfeb522508c02b67497
MD5 38575261ef78526613829dc003780364
BLAKE2b-256 1af4d03c34680d210d66da1cd7560c1660fb7e2d325dd6057d622aee747b0e61

See more details on using hashes here.

File details

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

File metadata

  • Download URL: simplesubnet-0.1.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 7a1f52455232181696b092b358883c210a7dd4b8e0eb7148a4ae973c519f9540
MD5 cbd0ecc993f1527cfe98df96378e0aaf
BLAKE2b-256 aa059ed4c613c975356a0e1073cd7bb68570b9b5b90ce05a003657e5b0c265eb

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