{"id":16673631,"url":"https://github.com/nathan-fiscaletti/parameterparser-py","last_synced_at":"2025-12-28T22:48:08.844Z","repository":{"id":57450739,"uuid":"196763125","full_name":"nathan-fiscaletti/parameterparser-py","owner":"nathan-fiscaletti","description":"✔️An advanced parameter parser for Python","archived":false,"fork":false,"pushed_at":"2019-12-05T21:50:16.000Z","size":46,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-19T09:38:06.724Z","etag":null,"topics":["cli","command-line-parser","parameter","parameter-parser","parameters","python","python3"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nathan-fiscaletti.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":"2019-07-13T20:24:01.000Z","updated_at":"2019-12-05T21:49:02.000Z","dependencies_parsed_at":"2022-09-26T17:31:35.021Z","dependency_job_id":null,"html_url":"https://github.com/nathan-fiscaletti/parameterparser-py","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathan-fiscaletti%2Fparameterparser-py","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathan-fiscaletti%2Fparameterparser-py/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathan-fiscaletti%2Fparameterparser-py/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathan-fiscaletti%2Fparameterparser-py/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nathan-fiscaletti","download_url":"https://codeload.github.com/nathan-fiscaletti/parameterparser-py/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243325055,"owners_count":20273212,"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":["cli","command-line-parser","parameter","parameter-parser","parameters","python","python3"],"created_at":"2024-10-12T12:27:34.550Z","updated_at":"2025-12-28T22:48:08.807Z","avatar_url":"https://github.com/nathan-fiscaletti.png","language":"Python","readme":"# Parameter Parser (Python)\n\n\u003e **Parameter Parser** is a simple library used to parse intricate parameters from an array of strings.\n\n\u003e **Hint:** This package is available through `Python PIP`.\n\u003e `pip install parameterparser` \n\n#### Supports Python 2.7+\n\n[![PyPI version](https://badge.fury.io/py/parameterparser.svg)](https://badge.fury.io/py/parameterparser)\n[![PyCodeStyle](./stylebadge.svg)](./tests/latest.stylelog)\n[![Downloads](https://pepy.tech/badge/parameterparser)](https://pepy.tech/project/parameterparser)\n[![GitHub issues](https://img.shields.io/github/issues/nathan-fiscaletti/parameterparser-py.svg)](https://github.com/nathan-fiscaletti/parameterparser-py/issues)\n![PyPI - License](https://img.shields.io/pypi/l/parameterparser.svg)\n\n[Documentation](./docs/) - [Advanced Code Examples](./examples/readme.md) - [Looking for the PHP version?](https://github.com/nathan-fiscaletti/parameterparser)\n\n### Features\n* Parse command line parameters.\n* Assign aliases to parameters.\n* Custom closures for each command line parameter.\n* Variadic closure support for arguments taking more than one value.\n* Customize the way the command line is parsed.\n\n### Example Usage\n```python\nimport sys\nfrom parameterparser import Parameter, Cluster, Parser\n\n# Initialize a new Cluster\nparameters = Cluster()\n\n# Add a Parameter to the Cluster\nparameter = Parameter(\"-\", \"name\", lambda name: name)\n\nparameter.set_required(True)\\\n         .set_description(\"Your name.\")\n\nparameters.add(parameter)\n\n# Create a new Parser using the Cluster\nparser = Parser(sys.argv, parameters)\n\n# Parse the parameters using the Parser.\nresults = parser.parse()\n\n# Verify that the parameters were valid after parsing.\nif not parser.is_valid():\n    # Since it was not valid, output usage.\n    parameters.print_full_usage(\n        \"Parameter Parser\",\n        \"An advanced parameter parser for Python\",\n        \"v1.0.0\"\n    )\nelse:\n    # Retrieve the name from the results\n    name = results['name']\n\n    # Output the name\n    print(\"Your name is \" + name + os.linesep)\n```\n\n### Output\n```\n~/ python test.py -name 'Nathan Fiscaletti'\n\n   Your name is Nathan Fiscaletti\n```\n\n### Development\n\nBefore commiting anything, please create a pre-commit hook with the following content.\n\nThis will ensure that the pycodestyle badge is properly updated.\n\n```bash\n#!/bin/bash\npython3 tests/style.py\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnathan-fiscaletti%2Fparameterparser-py","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnathan-fiscaletti%2Fparameterparser-py","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnathan-fiscaletti%2Fparameterparser-py/lists"}