How it works
Project flow: IP list → loop → requests.get(..., timeout=5) → raise_for_status() → response.json() → status check → report row. Separating get_ip_info(ip) from main() makes the logic testable and lets you change APIs without rewriting the program.
Extensions: input through sys.argv or a file, CSV/JSON output, a fallback API and OTX/VirusTotal checks with keys from os.environ. Test report formatting offline first, including status: fail, without spending real requests.
- Extract format_row(record) from the loop and test two offline cases: success and fail.
- Add sys.argv input to main: one IP or Usage when no argument is given.
- Save an offline report to CSV with ip,country,isp columns.
