The IPinfo CLI natively supports IP to Country ASN database downloads

IPinfo CLI: GitHub - ipinfo/cli: Official Command Line Interface for the IPinfo API (IP geolocation and other types of IP data)

ipinfo download -h
Usage: ipinfo download [<opts>] <database> [<output>]

Description:
    Download the free ipinfo databases.

Examples:
    # Download country database in csv format.
    $ ipinfo download country -f csv > country.csv
    $ ipinfo download country-asn country_asn.mmdb

Databases:
    asn            free ipinfo asn database.
    country        free ipinfo country database.
    country-asn    free ipinfo country-asn database.

Options:
  General:
    --token <tok>, -t <tok>
      use <tok> as API token.
    --help, -h
      show help.

Outputs:
    --compress, -c
      save the file in compressed format.
      default: false.
    --format, -f <mmdb | json | csv>
      output format of the dat