(self, ip)
return {"asn": asn, "name": asn_name}
Take an IP address and returns the asn number and name
        returns {'asn': 1234, 'name': 'FORTUM-AS Fortum, FI'}
        If not found, returns {'asn': 0, 'name': ''}
Take an IP address and returns the asn number and name
        returns {'asn': 1234, 'name': 'FORTUM-AS Fortum, FI'}
        If not found, returns {'asn': 0, 'name': ''}
Take an IP address and returns the asn number and name returns { asn : 1234 name : FORTUM - AS Fortum FI } If not found returns { asn : 0 name : }
def ip_get_asn(self, ip):
        """
        Take an IP address and returns the asn number and name
        returns {'asn': 1234, 'name': 'FORTUM-AS Fortum, FI'}
        If not found, returns {'asn': 0, 'name': ''}
        """
        self.check_geoipdb()
        try:
            asndb = geoip2.database.Reader(self.geoasn)
            res = asndb.asn(ip)
            asn = res.autonomous_system_number
            asn_name = res.autonomous_system_organization
        except geoip2.errors.AddressNotFoundError:
            # TODO: check in the other ASN db
            return {"asn": 0, "name": ""}
        return {"asn": asn, "name": asn_name}
def ip_get_asn ( self , ip ) : self . check_geoipdb ( ) try : asndb = geoip2 . database . Reader ( self . geoasn ) res = asndb . asn ( ip ) asn = res . autonomous_system_number asn_name = res . autonomous_system_organization except geoip2 . errors . AddressNotFoundError : # TODO: check in the other ASN db return { "asn" : 0 , "name" : "" } return { "asn" : asn , "name" : asn_name }