Skip to main content

A package to subnet ip address for static or dynamic networking.

Project description


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.


Use the package manager pip to install the subnet.

pip install subnet


import subnet as sb

IP = ""

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)

Dynamic Subnetting

a = sb.Subnet(IP,data)


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.



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

Uploaded source

Built Distribution

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

Uploaded py3

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