Staging: this is not the live site, pydocs.org.
Internet Protocols and Support
This class represents and manipulates 32-bit IPv4 network + addresses..
Attributes: [examples for IPv4Network('192.0.2.0/27')]
.network_address: IPv4Address('192.0.2.0')
.hostmask: IPv4Address('0.0.0.31')
.broadcast_address: IPv4Address('192.0.2.32')
.netmask: IPv4Address('255.255.255.224')
.prefixlen: 27Changed in 3.5
- 3.5: Added the two-tuple form for the address constructor parameter.
Members of IPv4Network
c
- compressed
- Return the shorthand version of the IP address as a string.
e
- exploded
- Return the longhand version of the IP address as a string.
h
- hostmask
- The host mask, as an IPv4Address object.
- hosts
- Generate Iterator over usable hosts in a network.
i
- is_multicast
- Test if the address is reserved for multicast use.
- is_private
- Test if this network belongs to a private range.
- is_reserved
- Test if the address is otherwise IETF reserved.
m
- max_prefixlen
- Refer to the corresponding attribute documentation in IPv4Address.
n
- netmask
- The net mask, as an IPv4Address object.
o
- overlaps
- Tell if self is partly contained in other.
p
- prefixlen
- Length of the network prefix, in bits.
s
- subnet_of
- Return True if this network is a subnet of other.
- subnets
- The subnets which join to make the current subnet.
- supernet
- The supernet containing the current network.
- supernet_of
- Return True if this network is a supernet of other.
v
- version
- Refer to the corresponding attribute documentation in IPv4Address.
w
- with_hostmask
- A string representation of the network, with the mask in host mask notation.
- with_netmask
- A string representation of the network, with the mask in net mask notation.
- with_prefixlen
- A string representation of the network, with the mask in prefix notation.