{"id":23413185,"url":"https://github.com/unmade/thrift-pyi","last_synced_at":"2026-02-17T22:08:11.779Z","repository":{"id":34900734,"uuid":"187158490","full_name":"unmade/thrift-pyi","owner":"unmade","description":"Simple `.pyi` stubs generator from thrift interfaces","archived":false,"fork":false,"pushed_at":"2026-01-28T22:26:44.000Z","size":192,"stargazers_count":23,"open_issues_count":3,"forks_count":12,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-29T13:40:44.706Z","etag":null,"topics":["ast","astunparse","poetry","pyi","python-stubs","python3","thrift","thriftpy2"],"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/unmade.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","contributing":"CONTRIBUTING.rst","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":"AUTHORS.rst","dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-05-17T06:22:48.000Z","updated_at":"2025-09-19T02:38:28.000Z","dependencies_parsed_at":"2024-04-27T22:24:42.376Z","dependency_job_id":"4bb68296-f069-4386-9454-4ffc8eb40747","html_url":"https://github.com/unmade/thrift-pyi","commit_stats":{"total_commits":82,"total_committers":5,"mean_commits":16.4,"dds":0.07317073170731703,"last_synced_commit":"696b8101632513b5ef4ed93e7a5b91de4acbc048"},"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"purl":"pkg:github/unmade/thrift-pyi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unmade%2Fthrift-pyi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unmade%2Fthrift-pyi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unmade%2Fthrift-pyi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unmade%2Fthrift-pyi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unmade","download_url":"https://codeload.github.com/unmade/thrift-pyi/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unmade%2Fthrift-pyi/sbom","scorecard":{"id":910767,"data":{"date":"2025-08-11","repo":{"name":"github.com/unmade/thrift-pyi","commit":"8b2a27228df7f9f4e14057c27d4dd6c7755cfb4c"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.6,"checks":[{"name":"Code-Review","score":2,"reason":"Found 5/17 approved changesets -- score normalized to 2","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":"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":"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/lint.yml:1","Warn: no topLevel permission defined: .github/workflows/publish.yml:1","Warn: no topLevel permission defined: .github/workflows/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":"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/lint.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/unmade/thrift-pyi/lint.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/lint.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/unmade/thrift-pyi/lint.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/lint.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/unmade/thrift-pyi/lint.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/lint.yml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/unmade/thrift-pyi/lint.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/unmade/thrift-pyi/publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/unmade/thrift-pyi/publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/unmade/thrift-pyi/test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/unmade/thrift-pyi/test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:30: update your workflow using https://app.stepsecurity.io/secureworkflow/unmade/thrift-pyi/test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:36: update your workflow using https://app.stepsecurity.io/secureworkflow/unmade/thrift-pyi/test.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test.yml:55: update your workflow using https://app.stepsecurity.io/secureworkflow/unmade/thrift-pyi/test.yml/master?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/lint.yml:40","Warn: pipCommand not pinned by hash: .github/workflows/lint.yml:41","Warn: pipCommand not pinned by hash: .github/workflows/publish.yml:26","Warn: pipCommand not pinned by hash: .github/workflows/publish.yml:27","Warn: pipCommand not pinned by hash: .github/workflows/test.yml:43","Warn: pipCommand not pinned by hash: .github/workflows/test.yml:44","Info:   0 out of  10 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   0 out of   6 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":"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":"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":"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":"Vulnerabilities","score":6,"reason":"4 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2024-48 / GHSA-fj7x-q9j7-g6q6","Warn: Project is vulnerable to: PYSEC-2022-42969","Warn: Project is vulnerable to: PYSEC-2024-187 / GHSA-rqc4-2hc7-8c8v","Warn: Project is vulnerable to: GHSA-jfmj-5v4g-7637"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 27 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-24T19:03:37.713Z","repository_id":34900734,"created_at":"2025-08-24T19:03:37.713Z","updated_at":"2025-08-24T19:03:37.713Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29559968,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-17T21:50:49.831Z","status":"ssl_error","status_checked_at":"2026-02-17T21:46:15.313Z","response_time":100,"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":["ast","astunparse","poetry","pyi","python-stubs","python3","thrift","thriftpy2"],"created_at":"2024-12-22T19:26:05.481Z","updated_at":"2026-02-17T22:08:11.763Z","avatar_url":"https://github.com/unmade.png","language":"Python","readme":"========\nOverview\n========\n\n.. start-badges\n\n.. image:: https://github.com/unmade/thrift-pyi/workflows/lint%20and%20test/badge.svg?branch=master\n    :alt: Build Status\n    :target: https://github.com/unmade/thrift-pyi/blob/master/.github/workflows/lint-and-test.yml\n\n.. image:: https://codecov.io/github/unmade/thrift-pyi/coverage.svg?branch=master\n    :alt: Coverage Status\n    :target: https://codecov.io/github/unmade/thrift-pyi\n\n.. image:: https://api.codacy.com/project/badge/Grade/487480f045594e148309e8b7f1f71351\n    :alt: Codacy Badge\n    :target: https://app.codacy.com/app/unmade/thrift-pyi\n\n.. image:: https://requires.io/github/unmade/thrift-pyi/requirements.svg?branch=master\n    :alt: Requirements Status\n    :target: https://requires.io/github/unmade/thrift-pyi/requirements/?branch=master\n\n.. image:: https://img.shields.io/pypi/v/thrift-pyi.svg\n    :alt: PyPI Package latest release\n    :target: https://pypi.org/project/thrift-pyi\n\n.. image:: https://img.shields.io/pypi/wheel/thrift-pyi.svg\n    :alt: PyPI Wheel\n    :target: https://pypi.org/project/thrift-pyi\n\n.. image:: https://img.shields.io/pypi/pyversions/thrift-pyi.svg\n    :alt: Supported versions\n    :target: https://pypi.org/project/thrift-pyi\n\n.. image:: https://img.shields.io/badge/License-MIT-purple.svg\n    :alt: MIT License\n    :target: https://github.com/unmade/thrift-pyi/blob/master/LICENSE\n\n.. end-badges\n\nThis is simple `.pyi` stubs generator from thrift interfaces.\nMotivation for this project is to have autocomplete and type checking\nfor dynamically loaded thrift interfaces\n\nInstallation\n============\n\n.. code-block:: bash\n\n    pip install thrift-pyi\n\nQuickstart\n==========\n\nSample usage:\n\n.. code-block:: bash\n\n    $ thriftpyi example/interfaces --output example/app/interfaces\n\nAdditionally to generated stubs you might want to create `__init__.py` that will load thrift interfaces, for example:\n\n.. code-block:: python\n\n    from pathlib import Path\n    from types import ModuleType\n    from typing import Dict\n\n    import thriftpy2\n\n    _interfaces_path = Path(\"example/interfaces\")\n    _interfaces: Dict[str, ModuleType] = {}\n\n\n    def __getattr__(name):\n        try:\n            return _interfaces[name]\n        except KeyError:\n            interface = thriftpy2.load(str(_interfaces_path.joinpath(f\"{name}.thrift\")))\n            _interfaces[name] = interface\n            return interface\n\n\nTo see more detailed example of usage refer to `example app \u003chttps://github.com/unmade/thrift-pyi/blob/master/example\u003e`_\n\n--strict-optional\n-----------------\n\nPython and thrift are very different at argument handling.\nFor example in thrift the following will be correct declaration:\n\n.. code-block:: thrift\n\n    struct TodoItem {\n        1: required i32 id\n        3: optional i32 type = 1\n        2: required string text\n    }\n\nIn python, fields without default values cannot appear after fields with default\nvalues. Therefore by default all fields are optional with default to None.\nThis is compliant to `thriftpy2 \u003chttps://github.com/Thriftpy/thriftpy2\u003e`_.\n\nHowever, if you want more strict behaviour you can specify `--strict-optional` option.\nFor the case above, the following stubs will be generated:\n\n.. code-block:: python\n\n    from dataclasses import dataclass\n\n    @dataclass\n    class TodoItem:\n        id: int\n        type: int = 1\n        text: str\n\nDevelopment\n===========\n\nTo install pre-commit hooks::\n\n    pre-commit install\n\nTo run the all tests run::\n\n    tox\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funmade%2Fthrift-pyi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funmade%2Fthrift-pyi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funmade%2Fthrift-pyi/lists"}