How do I convert a list of IP addresses to a list of CIDRs? Google\'s ipaddr-py library has a method called summarize_address_range(first, last) that converts two IP addres
For the comment made by CaTalyst.X, note that you need to change to code in order for it to work.
This:
cidrs = netaddr.ip_range_to_cidrs('54.64.0.0', '54.71.255.255')
Needs to become this:
cidrs = netaddr.iprange_to_cidrs('54.64.0.0', '54.71.255.255')
If you use the first instance of the code, you'll get an exception since ip_range_to_cidrs isn't a valid attribute to the netaddr method.