Skip to main content

A small example package

Project description

Subnet

The Subnet is a python library that can subnet an IP address for different networks. A user can set the static or dynamic mode for subnetting. Currently, this library only supports IPv4 addresses.

Installation

Use the package manager pip to install the subnet.

pip install subnet

Usage

import subnet as sb

IP = "192.168.1.12/24"

To subnet this data for 3 networks (1,2,3) which have 10,3 and 0 hosts then the data variable would be in the following form.

data = {1:10,2:3,3:0}

This library automatically assigns the IP address for the network and broadcast even if the host's value is 0.

Static Subnetting

a = sb.Subnet(IP,data,static=True)
a.summary()

Dynamic Subnetting

a = sb.Subnet(IP,data)
a.summary()

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

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

subnet-0.0.1.tar.gz (3.2 kB view hashes)

Uploaded Source

Built Distribution

subnet-0.0.1-py3-none-any.whl (4.2 kB view hashes)

Uploaded Python 3

Supported by

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