Skip to main content

IP subnet calculator

Project description

About

This module allows you to perform IP subnet calculations, there is support for both IPv4 and IPv6 CIDR notation.

Example Usage

>>> import ipcalc
>>> for x in ipcalc.Network('172.16.42.0/30'):
...     print str(x)
...
172.16.42.0
172.16.42.1
172.16.42.2
172.16.42.3
>>> subnet = ipcalc.Network('2001:beef:babe::/48')
>>> print str(subnet.network())
2001:beef:babe:0000:0000:0000:0000:0000
>>> print str(subnet.netmask())
ffff:ffff:ffff:0000:0000:0000:0000:0000
>>> '192.168.42.23' in Network('192.168.42.0/24')
True
>>> long(IP('fe80::213:ceff:fee8:c937'))
338288524927261089654168587652869703991L

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

ipcalc-0.3.tar.gz (5.1 kB view details)

Uploaded Source

File details

Details for the file ipcalc-0.3.tar.gz.

File metadata

  • Download URL: ipcalc-0.3.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for ipcalc-0.3.tar.gz
Algorithm Hash digest
SHA256 9b597a4b4e8ceeaf0bd730489546ac0bbd93b421e67bc0ef8a83270e9118cc0c
MD5 1473b5d765512b929d961f6598a791e7
BLAKE2b-256 2a3fbe12aed9b4ff673b9bd697fe1765b8f391a29a1155c4b63def55c762d4ca

See more details on using hashes here.

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