Skip to main content

IP Grouping Python

Build Status Coverage Status Downloads License Supported Python versions Development Status

Usage

>>> import ipgroup
>>> from pprint import pprint
>>> ips = ["129.21.3.17", "129.21.206.5", 
           "8.8.8.8", "8.8.4.4", "192.168.1.1",
           "192.168.255.1", "172.16.5.6", "172.17.20.1"]
>>> example1 = ipgroup.IPv4Group(ips, 16)
>>> pprint(example1.group)
{'129.21.0.0/16': 2,
 '172.16.0.0/16': 1,
 '172.17.0.0/16': 1,
 '192.168.0.0/16': 2,
 '8.8.0.0/16': 2}
>>> example2 = ipgroup.IPv4Group(ips, 12)
>>> pprint(example2.group)
{'129.16.0.0/12': 2, 
 '172.16.0.0/12': 2, 
 '192.160.0.0/12': 2, 
 '8.0.0.0/12': 2}
>>> 
>>> total = ipgroup.totalAddresses(["1.0.0.0/8",
...                                  "1.0.0.0/4",
...                                  "2.0.0.0/8",
...                                  "2.0.0.0/16",
...                                  "2.1.1.0/24",
...                                  "1.0.0.0/16",
>>> total
268435456

Release files for ipgroup 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ipgroup 0.0.5
File Size Uploaded
ipgroup-0.0.5.tar.gz 3.7 kB Details

Release files / ipgroup-0.0.5.tar.gz

Download URL ipgroup-0.0.5.tar.gz
Size 3.7 kB
Tags Source
SHA-256 checksum
How to use checksums
2b09471c6d0ba717bd4e175c6ef939fcbd48b742e136e457ae5b6da18a263e67
BLAKE2b-256 checksum
How to use checksums
4b451120e79113bb2440f6619ac4217696b5768dc0d7ed650cf980611f20b92a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.1

Release history Release notifications | RSS feed

This release

0.0.5 This release

1 release file

0.0.3

1 release file

0.0.2

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page