{"id":15297479,"url":"https://github.com/xevoinc/argexec","last_synced_at":"2025-04-13T23:16:19.798Z","repository":{"id":57411414,"uuid":"271117476","full_name":"XevoInc/argexec","owner":"XevoInc","description":"Expose your Python functions to the command line with one easy step!","archived":false,"fork":false,"pushed_at":"2020-08-06T00:14:17.000Z","size":15,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-13T23:16:08.466Z","etag":null,"topics":["argexec","argparse","argparser","libraries","pypi","pypi-packages","python","python-3","python-3-8","python-decorator","python-decorators","python-functional","python-library","python-utility","python38"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/XevoInc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-06-09T21:53:17.000Z","updated_at":"2021-04-16T07:25:06.000Z","dependencies_parsed_at":"2022-08-27T19:12:41.546Z","dependency_job_id":null,"html_url":"https://github.com/XevoInc/argexec","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XevoInc%2Fargexec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XevoInc%2Fargexec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XevoInc%2Fargexec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XevoInc%2Fargexec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/XevoInc","download_url":"https://codeload.github.com/XevoInc/argexec/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248794569,"owners_count":21162615,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["argexec","argparse","argparser","libraries","pypi","pypi-packages","python","python-3","python-3-8","python-decorator","python-decorators","python-functional","python-library","python-utility","python38"],"created_at":"2024-09-30T19:17:47.323Z","updated_at":"2025-04-13T23:16:19.777Z","avatar_url":"https://github.com/XevoInc.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Argexec\n\n![Build status](https://img.shields.io/github/workflow/status/XevoInc/argexec/Push%20CI/master)\n[![PyPI](https://img.shields.io/pypi/v/argexec)](https://pypi.org/project/argexec/)\n![PyPI - License](https://img.shields.io/pypi/l/argexec)\n\nAn unobtrusive, elegant mechanism to provide seamless command line interfaces through argparse for Python functions.\nAll you have to do is decorate your function of choice with `@argexec` and away you go!\n\n## Features\n* Description parsing from docstring\n* Argument help parsing from reStructuredText-like docstrings\n* Argument type enforcement via [typeguard](https://github.com/agronholm/typeguard) from \n  [type hints](https://www.python.org/dev/peps/pep-0484/)\n* Argument default values from function signature\n* Support for the following argument types:\n  * All builtin primitives (`bool`, `int`, `float`, `str`, `bytes`)\n  * Fixed length tuples of a supported type\n  * Variable length tuples of a supported type\n  * Lists of a supported type\n* Extensible, complex custom type parsing via [`dynamic_dispatch`](https://github.com/XevoInc/dynamic_dispatch)\n\n## Install\n\nYou may install this via the [`argexec`](https://pypi.org/project/argexec/) package on [PyPi](https://pypi.org):\n\n```bash\npip3 install argexec\n```\n\n## Usage\n\nThe decorator may be applied to any Python function that meets the following requirements:\n* Is not a member function\n* Has [PEP 484](https://www.python.org/dev/peps/pep-0484/) type hints for all parameters\n* Does not use `*args` or `**kwargs`\n\nExample (`foo.py`):\n```python\n#!/usr/bin/python3\n\nfrom typing import Tuple\n\nfrom argexec import argexec\nfrom argexec.types import LogLevel\n\n@argexec\ndef _(w: int, x: Tuple[str, ...], y: LogLevel, z: bool = True):\n    \"\"\"\n    Hello, world!\n\n    :param w: foo.\n    :param x: bar.\n    :param y: baz.\n    :param z: qux.\n    \"\"\"\n    pass\n```\n\n```\n$ ./foo.py --help\nusage: foo.py [-h] [-y] [--no-z] w [x [x ...]]\n\nHello, world!\n\npositional arguments:\n  w           [int] foo\n  x           [Tuple[str, ...]] bar\n\noptional arguments:\n  -h, --help  show this help message and exit\n  -y, --y     [LogLevel=CRITICAL] baz (more flags for lower level)\n  --no-z      [bool=True] qux\n```\n\n\n\n## Development\n\nWhen developing, it is recommended to use Pipenv. To create your development environment:\n\n```bash\npipenv install --dev\n```\n\n### Testing\n\nTODO\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxevoinc%2Fargexec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxevoinc%2Fargexec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxevoinc%2Fargexec/lists"}