{"id":31225161,"url":"https://github.com/pylhc/generic_parser","last_synced_at":"2025-09-22T00:41:05.994Z","repository":{"id":45081333,"uuid":"201085116","full_name":"pylhc/generic_parser","owner":"pylhc","description":"A parser for arguments and config files that also allows direct Python input and recursive parsing","archived":false,"fork":false,"pushed_at":"2025-07-25T10:35:25.000Z","size":7062,"stargazers_count":2,"open_issues_count":0,"forks_count":3,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-09-05T08:13:03.965Z","etag":null,"topics":["commandline-calls","generic-parser","ini-parser","parser","python"],"latest_commit_sha":null,"homepage":"https://pylhc.github.io/generic_parser/","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/pylhc.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":".zenodo.json"}},"created_at":"2019-08-07T16:13:55.000Z","updated_at":"2025-08-13T07:27:54.000Z","dependencies_parsed_at":"2024-08-09T14:46:10.603Z","dependency_job_id":"e1815dfb-2de9-4916-b633-53d9145760d2","html_url":"https://github.com/pylhc/generic_parser","commit_stats":{"total_commits":51,"total_committers":6,"mean_commits":8.5,"dds":0.6666666666666667,"last_synced_commit":"98cbde910d84b3ec8217a8a5a7190ee87e373dba"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/pylhc/generic_parser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pylhc%2Fgeneric_parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pylhc%2Fgeneric_parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pylhc%2Fgeneric_parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pylhc%2Fgeneric_parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pylhc","download_url":"https://codeload.github.com/pylhc/generic_parser/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pylhc%2Fgeneric_parser/sbom","scorecard":{"id":751545,"data":{"date":"2025-08-11","repo":{"name":"github.com/pylhc/generic_parser","commit":"926756465fbaddba92c5629ae452094c0d544b8b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.8,"checks":[{"name":"Maintained","score":0,"reason":"1 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: third-party GitHubAction not pinned by hash: .github/workflows/coverage.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/pylhc/generic_parser/coverage.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/cron.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/pylhc/generic_parser/cron.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/documentation.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/pylhc/generic_parser/documentation.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/publish.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/pylhc/generic_parser/publish.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/tests.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/pylhc/generic_parser/tests.yml/master?enable=pin","Info:   0 out of   5 third-party GitHubAction 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":"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":"Code-Review","score":10,"reason":"all changesets reviewed","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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/coverage.yml:1","Warn: no topLevel permission defined: .github/workflows/cron.yml:1","Warn: no topLevel permission defined: .github/workflows/documentation.yml:1","Warn: no topLevel permission defined: .github/workflows/publish.yml:1","Warn: no topLevel permission defined: .github/workflows/tests.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":"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":"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":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"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":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"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":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"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":"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 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"}}]},"last_synced_at":"2025-08-22T20:31:33.970Z","repository_id":45081333,"created_at":"2025-08-22T20:31:33.970Z","updated_at":"2025-08-22T20:31:33.970Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276329458,"owners_count":25623326,"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","status":"online","status_checked_at":"2025-09-21T02:00:07.055Z","response_time":72,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["commandline-calls","generic-parser","ini-parser","parser","python"],"created_at":"2025-09-22T00:41:03.474Z","updated_at":"2025-09-22T00:41:05.985Z","avatar_url":"https://github.com/pylhc.png","language":"Python","readme":"# Generic Parser\n[![Cron Testing](https://github.com/pylhc/generic_parser/workflows/Cron%20Testing/badge.svg)](https://github.com/pylhc/generic_parser/actions?query=workflow%3A%22Cron+Testing%22)\n[![Code Climate coverage](https://img.shields.io/codeclimate/coverage/pylhc/generic_parser.svg?style=popout)](https://codeclimate.com/github/pylhc/generic_parser)\n[![Code Climate maintainability (percentage)](https://img.shields.io/codeclimate/maintainability-percentage/pylhc/generic_parser.svg?style=popout)](https://codeclimate.com/github/pylhc/generic_parser)\n\u003c!-- [![GitHub last commit](https://img.shields.io/github/last-commit/pylhc/generic_parser.svg?style=popout)](https://github.com/pylhc/generic_parser/) --\u003e\n[![PyPI Version](https://img.shields.io/pypi/v/generic_parser?label=PyPI\u0026logo=pypi)](https://pypi.org/project/generic_parser/)\n[![GitHub release](https://img.shields.io/github/v/release/pylhc/generic_parser?logo=github)](https://github.com/pylhc/generic_parser/)\n[![Conda-forge Version](https://img.shields.io/conda/vn/conda-forge/generic_parser?color=orange\u0026logo=anaconda)](https://anaconda.org/conda-forge/generic_parser)\n[![DOI](https://zenodo.org/badge/201085116.svg)](https://zenodo.org/badge/latestdoi/201085116)\n\nThe package provides an all-around parser for arguments and config-files.\nThe creation of the arguments is similar to the ones from argparse, but the input can then be either from command line, a config file or directly from python.\n\nSee the [API documentation](https://pylhc.github.io/generic_parser/) for details.\n\n## Installing\n\nInstallation is easily done via `pip`. The package is then used as `generic_parser`.\n```bash\npython -m pip install generic-parser\n```\n\nOne can also install in a `conda` environment via the `conda-forge` channel with:\n```bash\nconda install -c conda-forge generic_parser\n```\n\n## Example Usage:\n\nContent of `myscript.py`\n```python\nfrom generic_parser import entrypoint, EntryPointParameters\n\n\ndef get_arguments():\n    args = EntryPointParameters()\n    args.add_parameter(name=\"first\",\n                       flags=[\"-f\", \"--first\"],\n                       help=\"First Parameter, an int\",\n                       choices=[1, 2, 3],\n                       type=int,\n                       required=True,\n                       )\n    args.add_parameter(name=\"second\",\n                       flags=[\"-s\", \"--second\"],\n                       help=\"Second Parameter, a string\",\n                       type=str,\n                       default=\"default\",\n                       required=False,\n                       )\n    return args\n\n\n@entrypoint(get_arguments())\ndef main(opt, unknown):\n    print(opt.first == 1)\n    print(opt.second == \"default\")\n\n\nif __name__ == '__main__':\n    main()\n```\n\n### Commandline\n\nCalling that script with ``python myscript.py -f 1 -s \"test\"`` will result in:\n```\nTrue\nFalse\n```\n\nIt is assumed, that this is the standard mode of operation for your functions.\n\n#### Config File\n\nFurther, one can also use a config file `config.ini` containing:\n```\n[Section]\nfirst = 2\nsecond = \"Hello\"\n```\n\nand run the script with `python myscript.py --entry_cfg config.ini` leading to\n```\nFalse\nFalse\n```\n\nConfig files are very useful if you want to rerun your code with the same or similar parameters.\nEspecially the declaration of a `[DEFAULT]` section can be helpful.\nFor further information about config files, check the python [Config Parser](https://docs.python.org/3/library/configparser.html).\n\n### Python\nOr call the function directly from python code:\n```python\nif __name__ == '__main__':\n    main(first=1, second=\"World\")\n```\n\n```\nTrue\nFalse\n```\n\nThis is incredibly helpful if one wants to write python-wrappers around entrypoint-functions,\nand does not want to resort to commandline calls from python.\n\nNote that also in this case all variables are validated, courtesy of the `dict_parser`.\n`dict_parser` provides even multi-level dictionary checking functionality,\nwhich is not used in the `Entrypoint`, but can be handy in other use-cases.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpylhc%2Fgeneric_parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpylhc%2Fgeneric_parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpylhc%2Fgeneric_parser/lists"}