Skip to content

msoedov/cloud_ips

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cloud_ips

Check if an IP address is in the ranges used by AWS/GCP/DO/Azure. It fast, microsecond based cloud providers lookup by public ip

Features

  • GCP / AWS / Digital ocean ip ranges support
  • 1000x faster than a brute force lookup
  • Most recent data records
  • Fully typed with annotations and checked with mypy, PEP561 compatible
  • Easy to start: has lots of docs, tests, and tutorials

Usage

pip install cloud_ips
from cloud_ips.network import is_cloud

is_cloud("95.67.109.122")

>> False

Benchmarks

timeit.timeit(
    'is_cloud("95.67.89.122")', "from __main__ import is_cloud", number=1000,
)
>> 0.04331268899999999


timeit.timeit(
    'naive("95.67.89.122")', "from __main__ import naive", number=1000,
)
>> 3.5043050669999998

About

Cloud IP ranges / CIDR blocks used by all cloud service providers GCP/AWS/DO/Oracle/Azure

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published

Languages