A package to subnet ip address for static or dynamic networking.
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file subnet-0.0.2.tar.gz
.
File metadata
- Download URL: subnet-0.0.2.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 01cd622a3a703f11b9b63621df7fa3ae2c0be069f4a2d2dd4d6c142c1ef76e49 |
|
MD5 | d9e1fd5ac59f28ee72651d99ee1b3530 |
|
BLAKE2b-256 | c3031bca6b488f193f982e5079a75a0bd61db14153006f6ea70a15f0f88f125e |
File details
Details for the file subnet-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: subnet-0.0.2-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c240c6a7b527981931220aca42a44c81ace95513ff0e77cadf7a5789fd449fbc |
|
MD5 | 4eae0f60df82a3e393faac7bf98b14b4 |
|
BLAKE2b-256 | ba73b3dead83d804503ff751447e3df2a23fb76863bb25d5f1cbc36af89ecd66 |