{"id":19863431,"url":"https://github.com/sandialabs/reverse_argparse","last_synced_at":"2025-04-07T12:07:06.304Z","repository":{"id":166027566,"uuid":"641007289","full_name":"sandialabs/reverse_argparse","owner":"sandialabs","description":"A Python library to determine what exactly the user ran at the command line, along with default values, and any transformations that happened after parsing arguments.","archived":false,"fork":false,"pushed_at":"2025-03-31T02:35:06.000Z","size":704,"stargazers_count":41,"open_issues_count":26,"forks_count":5,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-31T11:03:43.303Z","etag":null,"topics":["argparse","parser","replicability","reproducibility","scr-2872","scripting","snl-comp-science-libs","snl-other","snl-performance-workflow","unparser"],"latest_commit_sha":null,"homepage":"https://reverse-argparse.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sandialabs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-15T15:23:11.000Z","updated_at":"2025-03-25T13:45:26.000Z","dependencies_parsed_at":"2023-09-29T00:02:12.009Z","dependency_job_id":"b067ba47-9d56-403c-ad57-51b53207cb77","html_url":"https://github.com/sandialabs/reverse_argparse","commit_stats":{"total_commits":125,"total_committers":3,"mean_commits":"41.666666666666664","dds":"0.20799999999999996","last_synced_commit":"fe287860fd8489238673aa760bbd715dbdaba7e5"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandialabs%2Freverse_argparse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandialabs%2Freverse_argparse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandialabs%2Freverse_argparse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandialabs%2Freverse_argparse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sandialabs","download_url":"https://codeload.github.com/sandialabs/reverse_argparse/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247648977,"owners_count":20972945,"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":["argparse","parser","replicability","reproducibility","scr-2872","scripting","snl-comp-science-libs","snl-other","snl-performance-workflow","unparser"],"created_at":"2024-11-12T15:14:40.158Z","updated_at":"2025-04-07T12:07:06.283Z","avatar_url":"https://github.com/sandialabs.png","language":"Python","readme":"![Lines of code](https://sloc.xyz/github/sandialabs/reverse_argparse/?category=code)\n[![codecov](https://codecov.io/gh/sandialabs/reverse_argparse/branch/master/graph/badge.svg?token=FmDStZ6FVR)](https://codecov.io/gh/sandialabs/reverse_argparse)\n[![CodeFactor](https://www.codefactor.io/repository/github/sandialabs/reverse_argparse/badge/master)](https://www.codefactor.io/repository/github/sandialabs/reverse_argparse/overview/master)\n[![CodeQL](https://github.com/sandialabs/reverse_argparse/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/sandialabs/reverse_argparse/actions/workflows/github-code-scanning/codeql)\n[![Conda Version](https://img.shields.io/conda/v/conda-forge/reverse-argparse?label=conda-forge)](https://anaconda.org/conda-forge/reverse-argparse)\n![Conda Downloads](https://img.shields.io/conda/d/conda-forge/reverse-argparse?label=conda-forge%20downloads)\n[![Continuous Integration](https://github.com/sandialabs/reverse_argparse/actions/workflows/continuous-integration.yml/badge.svg)](https://github.com/sandialabs/reverse_argparse/actions/workflows/continuous-integration.yml)\n[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE_OF_CONDUCT.md)\n[![GitHub contributors](https://img.shields.io/github/contributors/sandialabs/reverse_argparse.svg)](https://github.com/sandialabs/reverse_argparse/graphs/contributors)\n[![Documentation Status](https://readthedocs.org/projects/reverse-argparse/badge/?version=latest)](https://reverse-argparse.readthedocs.io/en/latest/?badge=latest)\n[![License](https://anaconda.org/conda-forge/reverse-argparse/badges/license.svg)](LICENSE.md)\n[![Merged PRs](https://img.shields.io/github/issues-pr-closed-raw/sandialabs/reverse_argparse.svg?label=merged+PRs)](https://github.com/sandialabs/reverse_argparse/pulls?q=is:pr+is:merged)\n[![OpenSSF Best Practices](https://bestpractices.coreinfrastructure.org/projects/7632/badge)](https://bestpractices.coreinfrastructure.org/projects/7632)\n[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/sandialabs/reverse_argparse/badge)](https://securityscorecards.dev/viewer/?uri=github.com/sandialabs/reverse_argparse)\n![Platforms](https://anaconda.org/conda-forge/reverse-argparse/badges/platforms.svg)\n[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit)\n[![pre-commit.ci Status](https://results.pre-commit.ci/badge/github/sandialabs/reverse_argparse/master.svg)](https://results.pre-commit.ci/latest/github/sandialabs/reverse_argparse/master)\n[![PyPI - Version](https://img.shields.io/pypi/v/reverse-argparse?label=PyPI)](https://pypi.org/project/reverse-argparse/)\n![PyPI - Downloads](https://img.shields.io/pypi/dm/reverse-argparse?label=PyPI%20downloads)\n![Python Version](https://img.shields.io/badge/Python-3.9|3.10|3.11|3.12|3.13-blue.svg)\n[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n\n# reverse_argparse\n\nWhereas [`argparse`][argparse] is concerned with taking a bunch of command line\narguments and parsing them, this package is intended to do the opposite; that\nis, it'll take the parsed arguments and create the effective command line\ninvocation of the script that generated them.  The motivation is to be able to\ntell users exactly what was used for all of the options, taking into\nconsideration any defaults and other transformations that might've been applied\nin the midst of parsing, such that users are able to reproduce a prior run of a\nscript exactly.\n\n[argparse]: https://docs.python.org/3/library/argparse.html\n\n## Installation\n\nTo get up and running with `reverse_argparse`, simply:\n```bash\npython3 -m pip install reverse-argparse\n```\n\n## Usage\n\nOnce the package is installed, you can simply\n```python\nfrom argparse import ArgumentParser\n\nfrom reverse_argparse import ReverseArgumentParser\n\n# Parse the command line arguments.\nparser = ArgumentParser()\n# Build out the parser however you like.\nargs = parser.parse_args()\n# Optionally post-process any `args`, as needed.\n\n# Do whatever you need to in the script.\n\n# Wrap things up.\nprint(\"This script executed the following:\")\nunparser = ReverseArgumentParser(parser, args)\nprint(unparser.get_pretty_command_line_invocation())\n```\n\nFor more detailed usage and API information, please see\n[our documentation][readthedocs].\n\n[readthedocs]: https://reverse-argparse.readthedocs.io\n\n## Where to Get Help\n\nIf you're having trouble with `reverse_argparse`, or just want to ask a\nquestion, head on over to [our issue board][issues].  If a quick search doesn't\nyield what you're looking for, feel free to file an issue.\n\n[issues]: https://github.com/sandialabs/reverse_argparse/issues\n\n## Contributing\n\nIf you're interested in contributing to the development of `reverse_argparse`,\nwe'd love to have your help :grinning:  Check out our\n[contributing guidelines](CONTRIBUTING.md) for how to get started.\n[Past contributors][contributors] include:\n* [@jmgate](https://github.com/jmgate)\n\n[contributors]: https://github.com/sandialabs/reverse_argparse/graphs/contributors\n\n## License \u0026 Copyright\n\nSee [LICENSE.md](LICENSE.md) and [COPYRIGHT.md](COPYRIGHT.md).\n\n## Credits\n\nSpecial thanks to [@mjsumpter][mjsumpter] for contributing to a prior iteration\nof this concept, and to [the GMS project][gms] for investing in the development\nof this package.\n\n[mjsumpter]: https://github.com/mjsumpter\n[gms]: https://github.com/SNL-GMS/GMS-PI25\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsandialabs%2Freverse_argparse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsandialabs%2Freverse_argparse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsandialabs%2Freverse_argparse/lists"}