New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

argufy

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

argufy

Inspection based parser based on argparse.

  • 0.1.2b4
  • PyPI
  • Socket score

Maintainers
1

python-argufy

license build codecov

Overview

Inspection based parser built on argparse. Build complex CLI interfaces by writing more code-complete applications.

Motivation

Argufy is designed to be an alternative to decorator based parsers such as Click. Decorators have limitations that prevent effective use of inspection without drawbacks. This parser easilly allows a CLI to be created with minimal effort while enabling inspection.

Install

pip install argufy

Create CLI module with a command and an argument.

def example(argument: bool = False):
    """Provide an example command.

    Parameters
    ----------
    argument: bool, optional
        Provide an example argument.

    """
    if argument:
        print('This is a true argument')
    else:
        print('This is a false argument')

Create a parser

from argufy import Parser
from . import cli

def main():
    """Do main function for CLI."""
    parser = Parser()
    parser.add_commands(cli)
    parser.dispatch()

if __name__ == '__main__':
    main()

Example help message.

$ command --help
usage: command [-h] {example} ...

positional arguments:
  {example}
    example             Provide an example command.

optional arguments:
  -h, --help            show this help message and exit

Example command help message.

$ command example --help
usage: command [-h] [--argument ARGUMENT]

optional arguments:
  -h, --help           show this help message and exit
  --argument ARGUMENT  Provide an example argument.

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc