{"id":47079546,"url":"https://github.com/espetro/refined","last_synced_at":"2026-03-12T06:52:26.726Z","repository":{"id":57460825,"uuid":"409753119","full_name":"espetro/refined","owner":"espetro","description":"Refinement types for Python","archived":false,"fork":false,"pushed_at":"2021-10-04T10:06:00.000Z","size":8,"stargazers_count":10,"open_issues_count":5,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-20T05:26:13.854Z","etag":null,"topics":["hacktoberfest","python","python3","refinement-types","type-hints"],"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/espetro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-09-23T21:50:37.000Z","updated_at":"2025-02-19T06:16:09.000Z","dependencies_parsed_at":"2022-09-15T20:22:28.844Z","dependency_job_id":null,"html_url":"https://github.com/espetro/refined","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/espetro/refined","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/espetro%2Frefined","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/espetro%2Frefined/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/espetro%2Frefined/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/espetro%2Frefined/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/espetro","download_url":"https://codeload.github.com/espetro/refined/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/espetro%2Frefined/sbom","scorecard":{"id":382893,"data":{"date":"2025-08-11","repo":{"name":"github.com/espetro/refined","commit":"c2f38418268e8d89634ede1265d869d8d54dc9d4"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.8,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/2 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":"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/main-build.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":"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":"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":"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":-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":"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":"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-build.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/espetro/refined/main-build.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main-build.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/espetro/refined/main-build.yml/master?enable=pin","Warn: containerImage not pinned by hash: Dockerfile:1: pin your Docker image by updating python:3.9-slim-buster to python:3.9-slim-buster@sha256:320a7a4250aba4249f458872adecf92eea88dc6abd2d76dc5c0f01cac9b53990","Warn: pipCommand not pinned by hash: Dockerfile:5","Warn: pipCommand not pinned by hash: Dockerfile:8","Warn: pipCommand not pinned by hash: .github/workflows/main-build.yml:25","Warn: pipCommand not pinned by hash: .github/workflows/main-build.yml:26","Warn: pipCommand not pinned by hash: .github/workflows/main-build.yml:27","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 containerImage dependencies pinned","Info:   0 out of   5 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":"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 1 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":"11 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2013-9 / GHSA-4gv5-qhvr-36vv","Warn: Project is vulnerable to: PYSEC-2021-437 / GHSA-5xp3-jfq3-5q8x","Warn: Project is vulnerable to: PYSEC-2019-160 / GHSA-c5h8-cq4v-cvfm","Warn: Project is vulnerable to: PYSEC-2013-8 / GHSA-g3p5-fjj9-h8gj","Warn: Project is vulnerable to: PYSEC-2020-173 / GHSA-gpvv-69j7-gwj8","Warn: Project is vulnerable to: PYSEC-2023-228 / GHSA-mq26-g339-26xf","Warn: Project is vulnerable to: PYSEC-2013-22 / GHSA-27x4-j476-jp5f","Warn: Project is vulnerable to: PYSEC-2025-49 / GHSA-5rjg-fvgr-3xxf","Warn: Project is vulnerable to: GHSA-cx63-2mw6-8hw5","Warn: Project is vulnerable to: PYSEC-2022-43012 / GHSA-r9hx-vwmv-q579","Warn: Project is vulnerable to: PYSEC-2022-43017 / GHSA-qwmp-2cf2-g9g6"],"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-18T15:53:39.735Z","repository_id":57460825,"created_at":"2025-08-18T15:53:39.735Z","updated_at":"2025-08-18T15:53:39.735Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30417676,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-12T06:40:58.731Z","status":"ssl_error","status_checked_at":"2026-03-12T06:40:40.296Z","response_time":114,"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":["hacktoberfest","python","python3","refinement-types","type-hints"],"created_at":"2026-03-12T06:52:26.526Z","updated_at":"2026-03-12T06:52:26.720Z","avatar_url":"https://github.com/espetro.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n    refined: refinement type hints in Python\n\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/espetro/refined/actions?query=workflow%3ATest+event%3Apush+branch%3Amaster\" target=\"_blank\"\u003e\n        \u003cimg src=\"https://github.com/espetro/refined/workflows/Test/badge.svg?event=push\u0026branch=master\" alt=\"Tests\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://pypi.org/project/refined\" target=\"_blank\"\u003e\n        \u003cimg src=\"https://img.shields.io/pypi/v/refined?color=%2334D058\u0026label=pypi%20package\" alt=\"Package version\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n`refined` is a Python 3 library that leverages the gradual type system in Python to constrain types by one or multiple\npredicates. In short, you can ensure that the following script won't raise an `IndexError`:\n\n```python\nfrom refined import refined, NonEmptyList\nfrom typing import Generator\n\n@refined\ndef head_with_tail_generator(ls: NonEmptyList[int]) -\u003e (int, Generator[int]):\n    return ls[0], (_ for _ in ls[1:])\n\n\nif __name__ == '__main__':\n    head, tail = head_with_tail_generator([])  # this call raises a RefinementTypeException\n    print(head)\n    [print(_) for _ in tail]\n```\n\n## Help\n\nSee [documentation][docs] for more details.\n\n## Installation\n\n`refined` is available for Python 3.7+:\n\n```shell\npip install -U refined\n```\n\n## Contributing\n\nFor guidance on setting up a development environment and how to make a contribution to `refined`, see\n[Contributing to refined][contributing].\n\n## Acknowledgements\n\nThis library is a port of [fthomas' `refined`][scala] Scala library, which, in turn, is a port of\n[Nikita Volkov's `refined`][haskell] Haskell library.\n\n[docs]: https://github.com/espetro/refined/wiki\n[contributing]: https://github.com/espetro/refined/blob/master/CONTRIBUTING.md\n[pep593]: https://www.python.org/dev/peps/pep-0593/\n[pep647]: https://www.python.org/dev/peps/pep-0647/\n[haskell]: http://nikita-volkov.github.io/refined\n[scala]: https://github.com/fthomas/refined","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fespetro%2Frefined","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fespetro%2Frefined","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fespetro%2Frefined/lists"}