{"id":34085231,"url":"https://github.com/dapryor/question-framework","last_synced_at":"2026-03-12T19:14:43.326Z","repository":{"id":54654247,"uuid":"303279061","full_name":"dapryor/question-framework","owner":"dapryor","description":"Framework for asking questions","archived":false,"fork":false,"pushed_at":"2022-10-30T19:59:50.000Z","size":57,"stargazers_count":1,"open_issues_count":7,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-11-28T10:16:08.455Z","etag":null,"topics":["framework","hacktoberfest","python","python3","user-interface"],"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/dapryor.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":"2020-10-12T04:41:19.000Z","updated_at":"2022-10-30T19:21:05.000Z","dependencies_parsed_at":"2023-01-21T00:00:41.336Z","dependency_job_id":null,"html_url":"https://github.com/dapryor/question-framework","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dapryor/question-framework","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dapryor%2Fquestion-framework","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dapryor%2Fquestion-framework/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dapryor%2Fquestion-framework/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dapryor%2Fquestion-framework/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dapryor","download_url":"https://codeload.github.com/dapryor/question-framework/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dapryor%2Fquestion-framework/sbom","scorecard":{"id":322271,"data":{"date":"2025-08-11","repo":{"name":"github.com/dapryor/question-framework","commit":"207687ddab5cef01fd55dd962bfb39d9f64917ae"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.8,"checks":[{"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":"Code-Review","score":4,"reason":"Found 9/22 approved changesets -- score normalized to 4","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":"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":"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:14: update your workflow using https://app.stepsecurity.io/secureworkflow/dapryor/question-framework/main.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/dapryor/question-framework/main.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/run-test.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/dapryor/question-framework/run-test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/run-test.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/dapryor/question-framework/run-test.yml/master?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/run-test.yml:28","Warn: pipCommand not pinned by hash: .github/workflows/run-test.yml:29","Warn: pipCommand not pinned by hash: .github/workflows/run-test.yml:30","Info:   0 out of   3 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   0 out of   3 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":"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","Warn: no topLevel permission defined: .github/workflows/run-test.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":"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":"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":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 17 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-18T01:40:06.129Z","repository_id":54654247,"created_at":"2025-08-18T01:40:06.129Z","updated_at":"2025-08-18T01:40:06.129Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27728752,"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-12-14T02:00:11.348Z","response_time":56,"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":["framework","hacktoberfest","python","python3","user-interface"],"created_at":"2025-12-14T13:00:54.919Z","updated_at":"2025-12-14T13:00:55.549Z","avatar_url":"https://github.com/dapryor.png","language":"Python","readme":"\u003cp align=\"center\"\u003e\n  \u003cimg height=\"200px\" src=\"https://raw.githubusercontent.com/dapryor/question-framework/master/assets/logo.png\"\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n       \u003cb\u003eQuestion Framework helps you to ask questions and get answers in a declarative way!\u003c/b\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/dapryor/question-framework/blob/master/LICENSE\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/license/dapryor/question-framework.svg\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n# Question Framework\n\n## Basic Usage\n\n```python\nfrom question_framework.question import Question, RepeatedQuestion, BranchedQuestion\nfrom question_framework.user_input import ask\n\nquestions = [Question(\"Name\", \"Your name:\")]\nanswers = ask(questions)\nprint(answers)\n```\n\nOutput:\n\n```bash\nYour name:\nfoobar\n{'Name': 'foobar'}\n```\n\n## Question Types\n\n### Question\n\n`Question` is basically a question with an answer.\n\n```python\nquestions = [Question(\"Name\", \"Your name:\")]\nanswers = ask(questions)\nprint(answers)\n```\n\nOutput:\n\n```bash\nYour name:\nJohn Doe\n{'Name': 'John Doe'}\n```\n\n### Repeated Question\n\n`RepeatedQuestion` can be used to ask same question consecutively.\n\n```python\nquestions = [RepeatedQuestion(\"Password\", \"Your password:\", 2)]\nanswers = ask(questions)\nprint(answers)\n```\n\nOutput:\n\n```bash\nYour password:\n123\nYour password:\n321\nYour password:\n765\n{'Password': ['123', '321', '765']}\n```\n\n### Branched Question\n\n`BranchedQuestion` can be used to create one way adventures.\n\n```python\ngame = [BranchedQuestion(\"Main\", \"Where to go? [N | E | S | W]\", [\n    Question(\"N\", \"North is cold. You died! (type anything to exit)\"),\n    Question(\"E\", \"You trigerred the trap. (type anything to exit)\"),\n    BranchedQuestion(\"S\", \"You found a tresure chest! [open | leave]\", [\n        Question(\"open\", \"It was a trap! (type anything to exit)\"),\n        Question(\"leave\", \"You leave the cave.. (type anything to exit)\"),\n    ]),\n    Question(\"W\", \"West is wild, you died! (type anything to exit)\"),\n])]\nanswers = ask(game)\n```\n\n### Static Answers\n\n\"StaticAnswer\" can be used to provide a default value.\n\n```python\nfrom question_framework.question import BranchedQuestion, StaticAnswer, Question\nquestions = [BranchedQuestion(\"password\", \"Do you want to enter a password? [y|n]\", [\n    Question(\"y\", \"What is your password?\"),\n    StaticAnswer(\"n\", \"No password.\")\n])]\nanswers = ask(questions)\n```\n\nOutput:\n\n```bash\nDo you want to enter a password? [y|n]\nn\n{'password': {'n': 'No password.', '__answer': 'n'}}\n```\n\n## Validations\n\nA validation function can be specified to validate answers. If validation fails, user will be asked to enter the input again.\n\n```python\nQuestion(\"Password\", \"Enter password:\", validation=lambda x: len(x) \u003e 5)\n```\n\n### Validation Error Messages\n\nWhen a user provides input that does not satify a validation function, it may be desireable to give them a message.  The ValidationError exception allows this.\n\nTo use, raise the ValidationError exception from your validation function with your desired message.\n\n```python\nfrom question_framework.question import Question\nfrom question_framework.user_input import ask\nfrom question_framework.validation import ValidationError\n\ndef is_not_blank(x):\n    if not x:\n        raise ValidationError(\"Your answer may not be blank.\")\n    return True\n\nquestions = [Question(\"Name\", \"Your name:\", validation=is_not_blank)]\nanswers = ask(questions)\n```\n\nOutput:\n\n```bash\nYour name:\nYour answer may not be blank.\nYour name:\nDavid\n{'Name': 'David'}\n```\n\n## Post process\n\nA post process can be specified to transform answer.\n\n```python\nQuestion(\"Firstname\", \"Enter firstname:\", post_process=lambda x: x.upper())\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdapryor%2Fquestion-framework","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdapryor%2Fquestion-framework","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdapryor%2Fquestion-framework/lists"}