{"id":37071274,"url":"https://github.com/vanyakosmos/argser","last_synced_at":"2026-01-14T08:19:46.364Z","repository":{"id":50183913,"uuid":"214539182","full_name":"vanyakosmos/argser","owner":"vanyakosmos","description":"Arguments parsing without boilerplate.","archived":false,"fork":false,"pushed_at":"2022-12-08T06:43:59.000Z","size":177,"stargazers_count":15,"open_issues_count":10,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-25T08:42:49.556Z","etag":null,"topics":["arguments-parsing","cli","python"],"latest_commit_sha":null,"homepage":"https://argser.readthedocs.io/en/stable/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vanyakosmos.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-10-11T22:35:55.000Z","updated_at":"2023-06-27T13:39:16.000Z","dependencies_parsed_at":"2023-01-24T18:15:17.119Z","dependency_job_id":null,"html_url":"https://github.com/vanyakosmos/argser","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/vanyakosmos/argser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanyakosmos%2Fargser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanyakosmos%2Fargser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanyakosmos%2Fargser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanyakosmos%2Fargser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vanyakosmos","download_url":"https://codeload.github.com/vanyakosmos/argser/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanyakosmos%2Fargser/sbom","scorecard":{"id":916227,"data":{"date":"2025-08-11","repo":{"name":"github.com/vanyakosmos/argser","commit":"43d7c519ae739e564248e84a7b86bc372310ce66"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.2,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/20 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/main.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:30: update your workflow using https://app.stepsecurity.io/secureworkflow/vanyakosmos/argser/main.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:32: update your workflow using https://app.stepsecurity.io/secureworkflow/vanyakosmos/argser/main.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:56: update your workflow using https://app.stepsecurity.io/secureworkflow/vanyakosmos/argser/main.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:57: update your workflow using https://app.stepsecurity.io/secureworkflow/vanyakosmos/argser/main.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:9: update your workflow using https://app.stepsecurity.io/secureworkflow/vanyakosmos/argser/main.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/vanyakosmos/argser/main.yml/master?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/main.yml:16","Warn: pipCommand not pinned by hash: .github/workflows/main.yml:37","Warn: pipCommand not pinned by hash: .github/workflows/main.yml:38","Warn: pipCommand not pinned by hash: .github/workflows/main.yml:43","Warn: pipCommand not pinned by hash: .github/workflows/main.yml:47","Warn: pipCommand not pinned by hash: .github/workflows/main.yml:62","Warn: pipCommand not pinned by hash: .github/workflows/main.yml:63","Info:   0 out of   6 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   7 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 13 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"34 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2021-421 / GHSA-h4m5-qpfp-3mpv","Warn: Project is vulnerable to: PYSEC-2022-42986 / GHSA-43fp-rhv2-5gv8","Warn: Project is vulnerable to: PYSEC-2023-135 / GHSA-xqr8-7jwr-rhp7","Warn: Project is vulnerable to: PYSEC-2024-60 / GHSA-jjg7-2v4v-x38h","Warn: Project is vulnerable to: GHSA-cpwx-vrp4-4pq7","Warn: Project is vulnerable to: PYSEC-2021-66 / GHSA-g3rq-g295-4j3m","Warn: Project is vulnerable to: GHSA-h5c8-rqwp-cp95","Warn: Project is vulnerable to: GHSA-h75v-3vvj-5mfj","Warn: Project is vulnerable to: GHSA-q2x7-8rv6-6q7h","Warn: Project is vulnerable to: PYSEC-2020-92 / GHSA-hj5v-574p-mj7c","Warn: Project is vulnerable to: PYSEC-2022-42969","Warn: Project is vulnerable to: PYSEC-2021-140 / GHSA-9w8r-397f-prfh","Warn: Project is vulnerable to: PYSEC-2023-117 / GHSA-mrwq-x4v8-fh7p","Warn: Project is vulnerable to: PYSEC-2021-141 / GHSA-pq64-v7f5-gqh8","Warn: Project is vulnerable to: GHSA-9hjg-9r4m-mvj7","Warn: Project is vulnerable to: GHSA-9wx4-h78v-vm56","Warn: Project is vulnerable to: PYSEC-2023-74 / GHSA-j8r2-6x86-q33q","Warn: Project is vulnerable to: GHSA-34jh-p97f-mpxf","Warn: Project is vulnerable to: PYSEC-2023-212 / GHSA-g4mx-q9vg-27p4","Warn: Project is vulnerable to: PYSEC-2020-149 / GHSA-hmv2-79q8-fv6g","Warn: Project is vulnerable to: GHSA-pq67-6m6q-mj2v","Warn: Project is vulnerable to: PYSEC-2021-108 / GHSA-q2q7-5pp4-w6pg","Warn: Project is vulnerable to: PYSEC-2023-192 / GHSA-v845-jxx5-vc9f","Warn: Project is vulnerable to: PYSEC-2020-148 / GHSA-wqvq-5m8c-6g24","Warn: Project is vulnerable to: GHSA-jfmj-5v4g-7637","Warn: Project is vulnerable to: PYSEC-2024-48 / GHSA-fj7x-q9j7-g6q6","Warn: Project is vulnerable to: PYSEC-2021-856 / GHSA-5545-2q6w-2gh6","Warn: Project is vulnerable to: GHSA-6p56-wp2h-9hxr","Warn: Project is vulnerable to: PYSEC-2021-857 / GHSA-f7c7-j99h-c22f","Warn: Project is vulnerable to: GHSA-fpfv-jqm9-f5jm","Warn: Project is vulnerable to: PYSEC-2020-176 / GHSA-3pqx-4fqf-j49f","Warn: Project is vulnerable to: PYSEC-2020-96 / GHSA-6757-jp84-gxfx","Warn: Project is vulnerable to: PYSEC-2021-142 / GHSA-8q59-q68h-6hv4","Warn: Project is vulnerable to: PYSEC-2024-187 / GHSA-rqc4-2hc7-8c8v"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-24T21:05:35.861Z","repository_id":50183913,"created_at":"2025-08-24T21:05:35.861Z","updated_at":"2025-08-24T21:05:35.861Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28413772,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T08:16:59.381Z","status":"ssl_error","status_checked_at":"2026-01-14T08:13:45.490Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["arguments-parsing","cli","python"],"created_at":"2026-01-14T08:19:45.212Z","updated_at":"2026-01-14T08:19:46.358Z","avatar_url":"https://github.com/vanyakosmos.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# argser\n\n[![PyPI version](https://badge.fury.io/py/argser.svg)](http://badge.fury.io/py/argser)\n[![Downloads](https://pepy.tech/badge/argser)](https://pepy.tech/project/argser)\n[![Build Status](https://github.com/vanyakosmos/argser/workflows/tests/badge.svg)](https://github.com/vanyakosmos/argser/actions?workflow=tests)\n[![Coverage](https://codecov.io/gh/vanyakosmos/argser/branch/master/graph/badge.svg)](https://codecov.io/gh/vanyakosmos/argser)\n[![Docs](https://readthedocs.org/projects/argser/badge/?version=stable)](https://argser.readthedocs.io/en/stable/)\n\n[GitHub](https://github.com/vanyakosmos/argser) |\n[PyPI](https://pypi.org/project/argser/) |\n[Docs](https://argser.readthedocs.io/en/stable) |\n[Examples](https://argser.readthedocs.io/en/stable/examples.html) |\n[Installation](https://argser.readthedocs.io/en/stable/installation.html) |\n[Changelog](CHANGELOG.md)\n\nArguments parsing without boilerplate.\n\n## Features:\n- arguments and type hints in IDE\n- easy nested sub-commands\n- sane defaults for arguments' params (ie if default of arg is 3 then type should be int, or when annotation/type/default is `bool` then generate 2 arguments: for true value `--arg` and for false `--no-arg`, ...)\n- 𝕡𝕣𝕖𝕥𝕥𝕪 𝕡𝕣𝕚𝕟𝕥𝕚𝕟𝕘\n- support for argparse actions\n- common options/arguments reusability\n- auto shortcuts generation: `--verbose -\u003e -v, --foo_bar -\u003e --fb`\n- [auto completion](https://argser.readthedocs.io/en/latest/examples.html#auto-completion) in shell (tnx to [argcomplete](https://argcomplete.readthedocs.io/en/latest/))\n\n\n## Installation\n\n```text\npip install argser\npip install argser[tabulate]  # for fancy tables support\npip install argser[argcomplete]  # for shell auto completion\npip install argser[all]\n```\n\n\n## Notes for examples\n\nIf second parameter of `parse_args` is string (as in almost all examples) then it will be parsed,\notherwise arguments to parse will be taken from command line.\n\n\n## Simple example\n\n```python\nfrom argser import parse_args\n\nclass Args:\n    a = 'a'\n    foo = 1\n    bar: bool\n    bar_baz = 42, \"bar_baz help\"\n\nargs = parse_args(Args, show=True)\n```\n\n\u003cdetails\u003e\n\u003csummary\u003eargparse alternative\u003c/summary\u003e\n\n```python\nfrom argparse import ArgumentParser\n\nparser = ArgumentParser()\nparser.add_argument('-a', type=str, default='a', help=\"str, default: 'a'\")\nparser.add_argument('--foo', '-f', dest='foo', type=int, default=1, help=\"int, default: 1\")\nparser.add_argument('--bar', '-b', dest='bar', action='store_true', help=\"bool, default: None\")\nparser.add_argument('--no-bar', '--no-b', dest='bar', action='store_false')\nparser.set_defaults(bar=None)\nparser.add_argument('--bar-baz', dest='bar_baz', default=42, help=\"int, default: 42. bar_baz help\")\n\nargs = parser.parse_args()\nprint(args)\n```\n\u003c/details\u003e\n\n```text\n❯ python playground.py -a \"aaa bbb\" -f 100500 --no-b\n\u003e\u003e\u003e Args(bar=False, a='aaa bbb', foo=100500, bar_baz=42)\n```\n\n```text\n❯ python playground.py -h\nusage: playground.py [-h] [--bar] [--no-bar] [-a A] [--foo F] [--bar-baz B]\n\noptional arguments:\n    -h, --help           show this help message and exit\n    --bar, -b            bool, default: None\n    --no-bar, --no-b\n    -a A                 str, default: 'a'\n    --foo F, -f F        int, default: 1\n    --bar-baz B, --bb B  int, default: 42. bar_baz help\n```\n\n\n## Get arguments from function\n\n```python\nimport argser\n\ndef foo(a, b: int, c=1.2):\n    return [a, b, c]\n\nassert argser.call(foo, '1 2 -c 3.4') == ['1', 2, 3.4]\n```\n\n\n## Sub-commands\n\n```python\nfrom argser import parse_args, sub_command\n\nclass Args:\n    a: bool\n    b = []\n    c = 5\n\n    class SubArgs:\n        d = 1\n        e = '2'\n    sub = sub_command(SubArgs, help='help message for sub-command')\n\nargs = parse_args(Args, '-a -b a b -c 10', parser_help='help message for root parser')\nassert args.a is True\nassert args.b == ['a', 'b']\nassert args.c == 10\nassert args.sub is None\n\nargs = parse_args(Args, '--no-a -c 10 sub -d 5 -e \"foo bar\"')\nassert args.a is False\nassert args.sub.d == 5\nassert args.sub.e == 'foo bar'\n```\n\n```text\n❯ python playground.py -h\nusage: playground.py [-h] [-a] [--no-a] [-b [B [B ...]]] [-c C] {sub} ...\n\npositional arguments:\n    {sub}\n\noptional arguments:\n    -h, --help      show this help message and exit\n    -a              bool, default: None\n    --no-a\n    -b [B [B ...]]  List[str], default: []\n    -c C            int, default: 5\n```\n\n```text\n❯ python playground.py sub1 -h\nusage: playground.py sub [-h] [-d D] [-e E]\n\nhelp message for sub-command\n\noptional arguments:\n    -h, --help  show this help message and exit\n    -d D        int, default: 1\n    -e E        str, default: '2'\n```\n\nCan be deep nested:\n```python\nfrom argser import parse_args, sub_command\n\nclass Args:\n    a = 1\n    class Sub1:\n        b = 1\n        class Sub2:\n            c = 1\n            class Sub3:\n                d = 1\n            sub3 = sub_command(Sub3)\n        sub2 = sub_command(Sub2)\n    sub1 = sub_command(Sub1)\n\nargs = parse_args(Args, '-a 1 sub1 -b 2 sub2 -c 3 sub3 -d 4')\n```\n\n\n### Sub-commands from functions\n\n```python\nimport argser\nsubs = argser.SubCommands()\n\n@subs.add\ndef foo():\n    return 'foo'\n\n@subs.add(description=\"foo bar\")  # with additional arguments for sub-parser\ndef bar(a, b=1):\n    return [a, b]\n\nassert subs.parse('foo') == 'foo'\nassert subs.parse('bar 1 -b 2') == ['1', 2]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvanyakosmos%2Fargser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvanyakosmos%2Fargser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvanyakosmos%2Fargser/lists"}