{"id":16911439,"url":"https://github.com/gerlero/generala","last_synced_at":"2026-01-27T11:33:19.029Z","repository":{"id":57433512,"uuid":"235684986","full_name":"gerlero/generala","owner":"gerlero","description":"🎲  Probabilistic tool for the dice game of Generala","archived":false,"fork":false,"pushed_at":"2024-11-23T18:54:18.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-01T05:38:21.514Z","etag":null,"topics":["generala","numpy","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/gerlero.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":null}},"created_at":"2020-01-22T23:02:49.000Z","updated_at":"2025-09-07T19:52:31.000Z","dependencies_parsed_at":"2025-04-12T18:13:43.915Z","dependency_job_id":"7a43aa7a-e577-4513-9411-e0c4352950c5","html_url":"https://github.com/gerlero/generala","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/gerlero/generala","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gerlero%2Fgenerala","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gerlero%2Fgenerala/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gerlero%2Fgenerala/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gerlero%2Fgenerala/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gerlero","download_url":"https://codeload.github.com/gerlero/generala/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gerlero%2Fgenerala/sbom","scorecard":{"id":423760,"data":{"date":"2025-08-11","repo":{"name":"github.com/gerlero/generala","commit":"5d36dc711133ddf377b899f8cb781c01e3dadda3"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.1,"checks":[{"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/ci.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/gerlero/generala/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/gerlero/generala/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/gerlero/generala/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/gerlero/generala/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/gerlero/generala/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pypi-publish.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/gerlero/generala/pypi-publish.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pypi-publish.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/gerlero/generala/pypi-publish.yml/main?enable=pin","Info:   0 out of   3 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   4 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":"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":0,"reason":"Found 0/15 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":"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":"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Warn: no topLevel permission defined: .github/workflows/pypi-publish.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":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v1.0.1 not signed: https://api.github.com/repos/gerlero/generala/releases/23191767","Warn: release artifact v1.0.0 not signed: https://api.github.com/repos/gerlero/generala/releases/23190623","Warn: release artifact v1.0.1 does not have provenance: https://api.github.com/repos/gerlero/generala/releases/23191767","Warn: release artifact v1.0.0 does not have provenance: https://api.github.com/repos/gerlero/generala/releases/23190623"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: MIT License: LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"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 26 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-19T01:49:52.346Z","repository_id":57433512,"created_at":"2025-08-19T01:49:52.346Z","updated_at":"2025-08-19T01:49:52.346Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28812402,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T07:41:26.337Z","status":"ssl_error","status_checked_at":"2026-01-27T07:41:08.776Z","response_time":168,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["generala","numpy","python"],"created_at":"2024-10-13T19:05:57.984Z","updated_at":"2026-01-27T11:33:19.003Z","avatar_url":"https://github.com/gerlero.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🎲 generala\n\n[![CI](https://github.com/gerlero/generala/actions/workflows/ci.yml/badge.svg)](https://github.com/gerlero/generala/actions/workflows/ci.yml)\n[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n[![uv](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json)](https://github.com/astral-sh/uv)\n[![Publish](https://github.com/gerlero/generala/actions/workflows/pypi-publish.yml/badge.svg)](https://github.com/gerlero/generala/actions/workflows/pypi-publish.yml)\n[![PyPI](https://img.shields.io/pypi/v/generala)](https://pypi.org/project/generala/)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/generala)](https://pypi.org/project/generala/)\n\n**generala** is a probabilistic tool for the [dice game of Generala](https://en.wikipedia.org/wiki/Generala).\n\n**generala** helps you decide which dice to hold after each roll. Starting from the dice you have, the tool considers all possible future rolls to find which combinations of held dice give the best expected scores for the different categories.\n\nThe categories and scores in the tool correspond to the variant of the game played in my family. As there are many variants of the game—each of which assigns scores to the categories differently—you may want to check out the ```generala.categories``` module and modify it as desired.\n\n## Installation\n\n**generala** is available as a [Python package on PyPI](https://pypi.org/project/generala). Assuming you have Python 3.9 or later, install it by running the command:\n\n```bash\n$ pip install generala\n```\n\nor:\n\n```bash\n$ python3 -m pip install generala\n```\n\n## Usage\n\n### Command-line usage\n\nSuppose we got the dice (4,4,1,2,6) on the first roll in a game. Run **generala** as:\n\n```bash\n$ generala 1 44126\n```\n\nor, alternatively:\n\n```bash\n$ python3 -m generala 1 44126\n```\n\nThe program responds with the best expected scores for each category. The third column (\"Hold dice\") tells us which dice we should hold for the expected score to apply. The final row (\"any\") looks to maximize the overall expected score irrespective of category.\n\n```\nComputing. This may take a few seconds....\n   Category    Expected score Hold dice\n      1s             2.22     1\n      2s             4.44     2\n      3s             4.58     none\n      4s            11.67     44\n      5s             7.64     none\n      6s            13.33     6\n   Straight          5.52     24\n  Full house        13.47     44\nFour of a kind      17.18     44\n   Generala          2.91     44\nDouble Generala      0.00     any\n      any           33.15     44\n```\n\nLet's say we kept (4,4) and got (5,4,3) on the second roll. We run **generala** again:\n\n```bash\n$ generala 2 44543\n```\n\nThe tool outputs:\n\n```\n   Category    Expected score Hold dice\n      1s             0.83     none\n      2s             1.67     none\n      3s             5.00     3\n      4s            13.33     444\n      5s             8.33     5\n      6s             5.00     none\n   Straight          3.33     345\n  Full house         8.33     4445 or 3444\nFour of a kind      22.22     444\n   Generala          2.78     444\nDouble Generala      0.00     any\n      any           38.61     444\n```\n\nAfter the third and final roll, the tool can give the final scores. Assuming we have the dice (4,4,4,3,2):\n\n```bash\n$ generala 3 44432\n```\n\n```\n   Category      Score   \n      1s            0\n      2s            2\n      3s            3\n      4s           12\n      5s            0\n      6s            0\n   Straight         0\n  Full house        0\nFour of a kind      0\n   Generala         0\nDouble Generala     0\n      any          12\n```\n\n#### Closed categories\n\nYou can also specify, via options, which categories are closed (i.e., no longer available for scoring). For example, with:\n\n```bash\n$ generala -46fpg 1 44126\n```\n\nwe tell the tool that the categories 4s, 6s, Full house, Four of a kind, and Generala are closed—which results in those categories not being considered in the computation:\n\n```\n   Category    Expected score Hold dice\n      1s             2.22     1\n      2s             4.44     2\n      3s             4.58     none\n      5s             7.64     none\n   Straight          5.52     24\nDouble Generala      5.81     44\n      any           12.00     44\n```\n\nFor a list of all available options, run:\n\n```bash\n$ generala --help\n```\n\n### As a Python library\n\nIt is also possible to call into the functionality from a Python program. Here's an example.\n\n```python\nfrom generala import counts, dice\nfrom generala.categories import STRAIGHT, ALL\n\nc = counts((4,4,1,2,6))\n\nscore, held = STRAIGHT.expected_score(counts=c, roll=1, open_categories=ALL, return_held=True)\n\nprint(f\"Hold dice {dice(held[0])}. Expected score: {score:.2f}\")\n\n```\n\nWhen run, that snippet will print:\n\n```\nHold dice (2, 4). Expected score: 5.52\n```\n\nThat's all. Good luck!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgerlero%2Fgenerala","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgerlero%2Fgenerala","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgerlero%2Fgenerala/lists"}