shodan-python icon indicating copy to clipboard operation
shodan-python copied to clipboard

ENH: Create decorator to handle instantiating Shodan object

Open rmhowe425 opened this issue 1 year ago • 0 comments

Proposing the idea to convert get_api_key() in shodan.cli.helpers.py to a decorator that retrieves a user's API key and instantiates an instance of shodan.Shodan()

Proposed Implementation:

  • Proposed changes to existing functionality for get_api_key() shown below.
  • Add get_shodan_inst() decorator to all Shodan CLI commands.
  • Add positional api parameter to all Shodan CLI commands.
  • Remove function call to get_api_key() from Shodan CLI command function bodies.

Benefits:

  • Significantly reduces redundant code.
  • Improves overall readability of the code base.

image

rmhowe425 avatar Jul 20 '24 19:07 rmhowe425