pip install ipradar2
And check READ_ME.txt for more information.
Real-time detection and defense against malicious network activity and policy violations (exploits, port-scanners, advertising, telemetry, state surveillance, etc.)
For more information you can check the Windows variant of this tool, which is very similar:
Article in Code Project (Windows version)
Video Playlist (Windows version)