shodan-python
shodan-python copied to clipboard
ENH: Create decorator to handle instantiating Shodan object
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.