@ -2,4 +2,4 @@
|
||||
|
||||
"""MODULE: Specifies app version."""
|
||||
|
||||
VERSION = "1.2"
|
||||
VERSION = "1.2" # pragma: no cover
|
||||
|
@ -7,7 +7,7 @@ import argparse
|
||||
from app.query_normalisation import get_public_ip
|
||||
|
||||
|
||||
def parse_args() -> argparse.Namespace:
|
||||
def parse_args() -> argparse.Namespace: # pragma: no cover
|
||||
"""Get arguments from user via the command line."""
|
||||
parser = argparse.ArgumentParser(
|
||||
description="Query information about an IP address or domain name."
|
||||
|
@ -2,6 +2,8 @@
|
||||
|
||||
"""MODULE: Provides functions to call various APIs to retrieve IP/prefix information."""
|
||||
|
||||
from typing import Union
|
||||
|
||||
import ipaddress
|
||||
import requests
|
||||
|
||||
@ -24,7 +26,7 @@ def get_autonomous_system_number(as_info: str) -> str:
|
||||
return as_number
|
||||
|
||||
|
||||
def get_prefix_information(autonomous_system: int) -> list:
|
||||
def get_prefix_information(autonomous_system: int) -> Union[list, None]:
|
||||
"""Retrieves prefix information about a given autonomous system."""
|
||||
api_endpoint = f"https://api.hackertarget.com/aslookup/?q={str(autonomous_system)}"
|
||||
try:
|
||||
|
@ -2,10 +2,11 @@
|
||||
|
||||
"""MODULE: Provides functions for preparing, then printing, retrieved data."""
|
||||
|
||||
from typing import Union
|
||||
from tabulate import tabulate
|
||||
|
||||
|
||||
def generate_prefix_string(prefixes: list) -> str:
|
||||
def generate_prefix_string(prefixes: list) -> Union[str, None]:
|
||||
"""Generate a string that spilts prefixes into rows of 4."""
|
||||
num_per_row = 4
|
||||
try:
|
||||
|
Reference in New Issue
Block a user