python-validators / validators

Python Data Validation for Humans™.
MIT License
977 stars 155 forks source link

Add validation for public IP addresses #202

Closed biancarosa closed 1 year ago

biancarosa commented 2 years ago

While looking at the IPV4 validator, it looks like we could benefit to a validation using the https://docs.python.org/3/library/ipaddress.html#ipaddress.IPv4Address.is_private function to check if the IPAddress provided is public or not.

I was thinking of a kwarg named public just like the one used on the URL validator. Does that sound useful?