.. _f-magicparser: module ``ipythonhelper.magic_parser`` ===================================== .. inheritance-diagram:: pyquickhelper.ipythonhelper.magic_parser Short summary +++++++++++++ module ``pyquickhelper.ipythonhelper.magic_parser`` Magic parser to parse magic commands :githublink:`%|py|6` Classes +++++++ +-------------------------------------------------------------------------------------------+-------------------------------------------------------------------+ | class | truncated documentation | +===========================================================================================+===================================================================+ | :class:`MagicCommandParser ` | Adds method ``parse_cmd`` to :epkg:`*py:argparse:ArgumentParser`. | +-------------------------------------------------------------------------------------------+-------------------------------------------------------------------+ Static Methods ++++++++++++++ +--------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | staticmethod | truncated documentation | +==============================================================================================================+=====================================================================================+ | :py:meth:`_private_get_name ` | guesses the name of a parameter knowning the argument given to :meth:`add_argument` | +--------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ Methods +++++++ +-------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | method | truncated documentation | +=============================================================================================================+============================================================================================================================================================================================+ | :py:meth:`__init__ ` | custom constructor, see :epkg:`*py:argparse:ArgumentParser`. | +-------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :meth:`add_argument ` | Overloads the method, see `ArgumentParser `_. Among the ... | +-------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :meth:`eval ` | Evaluate a string knowing the context, it returns *value* if it does not belong to the context or if it ... | +-------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :meth:`expected_eval_type ` | return the expected evaluation type for the parameter (if the value is interpreter as a python expression) | +-------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :meth:`expected_type ` | Returns the expected type for the parameter. | +-------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :meth:`has_choices ` | tells if a parameter has choises | +-------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :meth:`has_eval ` | Tells if a parameter value should be consider as a variable or some python code to evaluate. | +-------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :meth:`parse_cmd ` | Splits line using `shlex `_ and call `parse_args `_ ... | +-------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Documentation +++++++++++++ .. automodule:: pyquickhelper.ipythonhelper.magic_parser :members: :special-members: __init__ :show-inheritance: