Had to use this script today, and found it nearly worked with Python 3, but needed a few tweaks. Hunted down the issues, and I'm submitting this PR here so other people can benefit from my trouble :)
Added a Pipfile (and Pipfile.lock)
Added a .gitignore for the MMDB files
Made a few tweaks to resolve various errors:
Fix a typo in the instructions for unzipping the ASN MMDB file
Open the output CSV in text mode, not binary mode
Switch to urllib.request instead of Python 2 urllib
Add python-geoip-python3 dependency to resolve errors
Tested this version on the sample data and it looks good, and I made mostly the same tweaks on my work machine and it worked well with real data.
Had to use this script today, and found it nearly worked with Python 3, but needed a few tweaks. Hunted down the issues, and I'm submitting this PR here so other people can benefit from my trouble :)
python-geoip-python3
dependency to resolve errorsTested this version on the sample data and it looks good, and I made mostly the same tweaks on my work machine and it worked well with real data.