Skip to main content

This module allows an easy manipulation of IPV4 addresses.

Project description

This module gives some utilities for IPV4 addresses. It defines the IP, Mask and Subnet classes. Objects of these classes should not be created directly, but rather through the function IPV4. It defines also some useful conversion functions.

>>> from IPV4 import IPV4
>>> a = IPV4('')
>>> a                   # a is a string
>>> a.set_mask(23) # same as a = IPV4('')
>>> a.mask         # or a = IPV4('', '')
>>> a.subnet.start
>>> a.subnet.end
>>> a.same_subnet('')
>>> a.bitstr
>>> a.subnet.bitmask
>>> a.hexaval
>>> a.intval
>>> a.IPclass

Project details

Release history Release notifications | RSS feed

This version


Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page