ScapyTools (version 0.0.1)
index
ScapyTools.html

This package implements tools to build python package and tools.
 
>>> arg = ScapyArguments()
>>> arg.parse_args().iface
<NetworkInterface ...>
>>> arg.parse_args(["-i", "eth0"]).iface
<NetworkInterface ...>
>>> arg.parse_args(["--interface", "eth"]).iface
<NetworkInterface ...>
 
>>> arg = ScapyArguments(interface_args=["++custom", "|c"], prefix_chars="+|")
>>> arg.parse_args().iface
<NetworkInterface ...>
>>> arg.parse_args(["|c", "127.0.0"]).iface
<NetworkInterface ...>
>>> arg.parse_args(["++custom", "00:00:00:"]).iface
<NetworkInterface ...>
 
>>> arg = ScapyArguments(interface_kwargs={"required", True}, description="My program description")
>>> arg.parse_args(["-i", "172.16.10."]).iface
<NetworkInterface ...>
>>> arg.parse_args(["--interface", "0A:00:34:"]).iface
<NetworkInterface ...>

 
Classes
       
argparse.ArgumentParser(argparse._AttributeHolder, argparse._ActionsContainer)
ScapyArguments

 
class ScapyArguments(argparse.ArgumentParser)
    ScapyArguments(*args, interface_args=['--interface', '-i'], interface_kwargs={'help': 'Part of the IP, MAC or name of the interface'}, **kwargs)
 
This class implements ArgumentsParser with
interface argument and iface research.
 
 
Method resolution order:
ScapyArguments
argparse.ArgumentParser
argparse._AttributeHolder
argparse._ActionsContainer
builtins.object

Methods defined here:
__init__(self, *args, interface_args=['--interface', '-i'], interface_kwargs={'help': 'Part of the IP, MAC or name of the interface'}, **kwargs)
Initialize self.  See help(type(self)) for accurate signature.
parse_args(self, args: List[str] = None, namespace: argparse.Namespace = None) -> argparse.Namespace
This function implements the iface
research from interface arguments.

Data and other attributes defined here:
__annotations__ = {'interface_args': <class 'list'>, 'interface_kwargs': <class 'dict'>}
interface_args = ['--interface', '-i']
interface_kwargs = {'help': 'Part of the IP, MAC or name of the interface'}

Methods inherited from argparse.ArgumentParser:
add_subparsers(self, **kwargs)
# ==================================
# Optional/Positional adding methods
# ==================================
convert_arg_line_to_args(self, arg_line)
error(self, message)
error(message: string)
 
Prints a usage message incorporating the message to stderr and
exits.
 
If you override this in a subclass, it should not return -- it
should either exit or raise an exception.
exit(self, status=0, message=None)
# ===============
# Exiting methods
# ===============
format_help(self)
format_usage(self)
# =======================
# Help-formatting methods
# =======================
parse_intermixed_args(self, args=None, namespace=None)
parse_known_args(self, args=None, namespace=None)
parse_known_intermixed_args(self, args=None, namespace=None)
print_help(self, file=None)
print_usage(self, file=None)
# =====================
# Help-printing methods
# =====================

Methods inherited from argparse._AttributeHolder:
__repr__(self)
Return repr(self).

Data descriptors inherited from argparse._AttributeHolder:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Methods inherited from argparse._ActionsContainer:
add_argument(self, *args, **kwargs)
add_argument(dest, ..., name=value, ...)
add_argument(option_string, option_string, ..., name=value, ...)
add_argument_group(self, *args, **kwargs)
add_mutually_exclusive_group(self, **kwargs)
get_default(self, dest)
register(self, registry_name, value, object)
# ====================
# Registration methods
# ====================
set_defaults(self, **kwargs)
# ==================================
# Namespace default accessor methods
# ==================================

 
Data
        __all__ = ['ScapyArguments']
__author_email__ = 'mauricelambert434@gmail.com'
__copyright__ = '\nPythonToolsKit Copyright (C) 2022 Maurice Lam...ome to redistribute it\nunder certain conditions.\n'
__description__ = '\nThis package implements tools to build python package and tools.\n'
__license__ = 'GPL-3.0 License'
__maintainer__ = 'Maurice Lambert'
__maintainer_email__ = 'mauricelambert434@gmail.com'
__url__ = 'https://github.com/mauricelambert/PythonToolsKit'

 
Author
        Maurice Lambert