code: def cmd_ip2asn(ip):
      
  
      try:
          ipaddress.ip_address(ip)
      except ValueError:
          logging.error('Invalid IP address')
          sys.exit(1)
  
      data = ip2asn(ip)
      print(json.dumps(data, indent=4))
docs: Use Team Cymru ip2asn service to get information about a public IPv4/IPv6.
  
      Reference: https://www.team-cymru.com/IP-ASN-mapping.html
  
      \b
      $ habu.ip2asn 8.8.8.8
      {
          "asn": "15169",
          "net": "8.8.8.0/24",
          "cc": "US",
          "rir": "ARIN",
          "asname": "GOOGLE - Google LLC, US",
          "country": "United States"
      }