This app provides a generating command 'asngen', which downloads MaxMind's autonomous system database, unzips the contents (in memory) and outputs a table of the results that can be easily put into a lookup.
To use this app you must first register a free account with MaxMind (https://www.maxmind.com/en/geolite2/signup) then generate a free license key.