dav_tools ========= .. py:module:: dav_tools .. autoapi-nested-parse:: Python library to aid in software development. Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/dav_tools/_arg_parser/index /autoapi/dav_tools/commands/index /autoapi/dav_tools/database/index /autoapi/dav_tools/devtools/index /autoapi/dav_tools/files/index /autoapi/dav_tools/messages/index /autoapi/dav_tools/requirements/index Attributes ---------- .. autoapisummary:: dav_tools.argument_parser Classes ------- .. autoapisummary:: dav_tools._ArgumentParser Package Contents ---------------- .. py:class:: _ArgumentParser Customized argument parser. Options and/or flags can be easily added, optionally inside (exclusive) groups. Some flags are automatically set. Command line options are parsed when calling for the first time the `args` property. .. py:method:: set_version(version) Add a ``--version`` option, which automatically displays project version. :param version: Current project version to display. .. py:method:: set_description(description) Set a brief description of the program, to be displayed on top when using the --help flag. :param description: A description of the program .. py:method:: set_developer_info(name, email) Set information about the developer of the project. These informations will be displayed at the bottom of the --help command. :param name: Name to be displayed :param email: Email address to be displayed .. py:property:: args :type: argparse.Namespace Parse and return arguments specified on command line. :returns: The arguments .. py:method:: parse_args() Parse command line arguments and store them in the ``args`` property. .. py:method:: __group(name, description = None) Return an argument group, or create it if it doesn't exist. :param name: Name of the group :param description: Group description :returns: The argument group .. py:method:: add_mutually_exclusive_group(parent = None) Create a mutually exclusive argument group. Only one option from this group can be used at a time. :param parent: If specified, create the new group as subgroup of parent, otherwise create it at top level :returns: The new mutually exclusive group .. py:method:: add_argument(*name_or_flags, group = None, **kwargs) Add an argument to the parser. :param name_or_flags: Name or flags of the new argument. These options are directly passed to the argparse library. :param group: Group in which to create the new argument. Can also be specified in string format. :param kwargs: Additional options to be passed to the underlying argparse library. .. py:method:: add_quiet_mode() Add a ``--quiet`` switch, which can be used in the program to suppress some output. Group and description are automatically set. .. py:method:: add_verbose_mode() Add a ``--verbose`` switch, which can be used in the program to produce more output. Group and description are automatically set. .. py:data:: argument_parser Argument parser instance -- use this instead of importing the ``_arg_parser`` module.