{"id":15944701,"url":"https://github.com/ybubnov/flagparse","last_synced_at":"2025-04-03T21:44:12.992Z","repository":{"id":57429924,"uuid":"206139765","full_name":"ybubnov/flagparse","owner":"ybubnov","description":"Python modular command-line interfaces.","archived":false,"fork":false,"pushed_at":"2019-10-19T18:29:08.000Z","size":18,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-03T11:56:21.096Z","etag":null,"topics":["cli","python"],"latest_commit_sha":null,"homepage":"","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/ybubnov.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-09-03T17:57:24.000Z","updated_at":"2022-04-18T20:27:09.000Z","dependencies_parsed_at":"2022-08-26T03:23:43.104Z","dependency_job_id":null,"html_url":"https://github.com/ybubnov/flagparse","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ybubnov%2Fflagparse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ybubnov%2Fflagparse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ybubnov%2Fflagparse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ybubnov%2Fflagparse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ybubnov","download_url":"https://codeload.github.com/ybubnov/flagparse/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247085993,"owners_count":20881158,"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","python"],"created_at":"2024-10-07T08:41:49.168Z","updated_at":"2025-04-03T21:44:12.976Z","avatar_url":"https://github.com/ybubnov.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flagparse\n\n[![Build Status][BuildStatus]](https://travis-ci.org/ybubnov/flagparse)\n\n\nFlagparse is a library for building modular command-line interfaces with\naccent on nested commands. This library removes the pain of manually\nconstructing the argument parsing and applying handler for each command, all\nof this is done by this tiny library.\n\n## Installation\n\n```bash\npip install flagparse\n```\n\n## Usage and documentation\n\nPlease see the [wiki][Wiki] for basic usage and other documentation of using\nflagparse.\n\nHere is an example of a simple Flagparse app:\n```py\nimport flagparse\n\n\nclass Sum(flagparse.SubCommand):\n    \"\"\"Sub-command to handle numbers summation.\"\"\"\n\n    name = \"sum\"\n    arguments = [\n        ([\"integers\"],\n         dict(metavar=\"INT\",\n              type=int,\n              nargs=\"+\",\n              help=\"integers to be summed\")),\n    ]\n\n    def handle(self, args: flagparse.Namespace) -\u003e None:\n        print(sum(args.integers))\n\n\nclass Calc(flagparse.Command):\n    \"\"\"A simple calculator that sums numbers.\"\"\"\n\n    name = \"calc\"\n\n\nif __name__ == \"__main__\":\n    Calc(subcommands=[Sum]).parse()\n```\n\nHow it looks when run:\n```bash\n$ python main.py sum 1 2 3\n6\n```\n\n## License\n\nThe openflow library is distributed under MIT license, therefore you are free\nto do with code whatever you want. See the [LICENSE](LICENSE) file for full\nlicense text.\n\n[BuildStatus]: https://travis-ci.org/ybubnov/flagparse.svg?branch=master\n[Wiki]: https://github.com/ybubnov/flagparse/wiki\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fybubnov%2Fflagparse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fybubnov%2Fflagparse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fybubnov%2Fflagparse/lists"}