pyasn
JSON →pyasn is a Python module for offline IP address to Autonomous System Number (ASN) lookups. It uses a compact IP prefix trie and runs entirely offline once the data files are downloaded. Version 1.6.2 is current; releases are infrequent (last major update 2019).