{"id":43324409,"url":"https://github.com/saltudelft/libsa4py","last_synced_at":"2026-02-01T23:04:35.203Z","repository":{"id":37904026,"uuid":"295364791","full_name":"saltudelft/libsa4py","owner":"saltudelft","description":"LibSA4Py: Light-weight static analysis for extracting type hints and features","archived":false,"fork":false,"pushed_at":"2023-08-23T08:06:43.000Z","size":465,"stargazers_count":12,"open_issues_count":6,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-11-27T18:30:23.847Z","etag":null,"topics":["ast-analysis","features-extraction","libsa4py","light-weight","machine-learning","python","static-analysis","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/saltudelft.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}},"created_at":"2020-09-14T09:16:31.000Z","updated_at":"2025-10-13T10:48:09.000Z","dependencies_parsed_at":"2023-01-29T11:45:41.818Z","dependency_job_id":null,"html_url":"https://github.com/saltudelft/libsa4py","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/saltudelft/libsa4py","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saltudelft%2Flibsa4py","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saltudelft%2Flibsa4py/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saltudelft%2Flibsa4py/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saltudelft%2Flibsa4py/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/saltudelft","download_url":"https://codeload.github.com/saltudelft/libsa4py/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saltudelft%2Flibsa4py/sbom","scorecard":{"id":796766,"data":{"date":"2025-08-11","repo":{"name":"github.com/saltudelft/libsa4py","commit":"edc96359bf6966f6ddc7f6ee7937a1b366d8ec8f"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.5,"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":"Code-Review","score":0,"reason":"Found 0/19 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":"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":"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/libsa4py_test.yaml:1","Warn: no topLevel permission defined: .github/workflows/publish.yaml: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":"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/libsa4py_test.yaml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/saltudelft/libsa4py/libsa4py_test.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/libsa4py_test.yaml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/saltudelft/libsa4py/libsa4py_test.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/libsa4py_test.yaml:30: update your workflow using https://app.stepsecurity.io/secureworkflow/saltudelft/libsa4py/libsa4py_test.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yaml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/saltudelft/libsa4py/publish.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yaml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/saltudelft/libsa4py/publish.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/publish.yaml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/saltudelft/libsa4py/publish.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yaml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/saltudelft/libsa4py/publish.yaml/master?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/libsa4py_test.yaml:20","Warn: pipCommand not pinned by hash: .github/workflows/libsa4py_test.yaml:21","Warn: pipCommand not pinned by hash: .github/workflows/libsa4py_test.yaml:22","Warn: pipCommand not pinned by hash: .github/workflows/publish.yaml:19","Warn: pipCommand not pinned by hash: .github/workflows/publish.yaml:20","Info:   0 out of   5 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction 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":"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":"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: Apache License 2.0: 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":"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":"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"}},{"name":"Vulnerabilities","score":0,"reason":"15 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2022-288 / GHSA-6hrg-qmvc-2xh8","Warn: Project is vulnerable to: PYSEC-2021-356 / GHSA-2ww3-fxvq-293j","Warn: Project is vulnerable to: PYSEC-2024-167 / GHSA-cgvx-9447-vcch","Warn: Project is vulnerable to: PYSEC-2021-859 / GHSA-f8m6-h2c7-8h9x","Warn: Project is vulnerable to: PYSEC-2019-106 / GHSA-mr7p-25v2-35wr","Warn: Project is vulnerable to: PYSEC-2022-5 / GHSA-rqjh-jp2r-59cj","Warn: Project is vulnerable to: PYSEC-2018-34 / GHSA-2fc2-6r4j-p65h","Warn: Project is vulnerable to: PYSEC-2021-856 / GHSA-5545-2q6w-2gh6","Warn: Project is vulnerable to: PYSEC-2019-108 / GHSA-9fq2-x9r6-wfmf","Warn: Project is vulnerable to: PYSEC-2018-33 / GHSA-cw6w-4rcx-xphc","Warn: Project is vulnerable to: PYSEC-2021-857 / GHSA-f7c7-j99h-c22f","Warn: Project is vulnerable to: GHSA-fpfv-jqm9-f5jm","Warn: Project is vulnerable to: PYSEC-2017-1 / GHSA-frgw-fgh6-9g52","Warn: Project is vulnerable to: PYSEC-2020-73","Warn: Project is vulnerable to: PYSEC-2017-74"],"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-23T09:13:56.884Z","repository_id":37904026,"created_at":"2025-08-23T09:13:56.884Z","updated_at":"2025-08-23T09:13:56.884Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28993794,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T22:01:47.507Z","status":"ssl_error","status_checked_at":"2026-02-01T21:58:37.335Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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-analysis","features-extraction","libsa4py","light-weight","machine-learning","python","static-analysis","type-hints"],"created_at":"2026-02-01T23:04:32.183Z","updated_at":"2026-02-01T23:04:35.196Z","avatar_url":"https://github.com/saltudelft.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Intro\n[![PyPI version](https://badge.fury.io/py/libsa4py.svg)](https://badge.fury.io/py/libsa4py) \n![GH Workflow](https://github.com/saltudelft/libsa4py/actions/workflows/libsa4py_test.yaml/badge.svg)\n[![codecov](https://codecov.io/gh/saltudelft/libsa4py/branch/master/graph/badge.svg?token=HLCIATJE6C)](https://codecov.io/gh/saltudelft/libsa4py)\n\n`LibSA4Py` is a static analysis library for Python, which extracts type hints and features for training ML-based type inference models.\n\n- [Requirements](#requirements)\n- [Quick Installation](#quick-installation)\n- [Usage](#usage)\n  - [Processing projects](#processing-projects)\n  - [Merging projects](#merging-projects)\n- [JSON Output](#json-output)\n\n# Requirements\n\n- Python 3.7 or newer (Python 3.8 is recommended)\n- [Watchman](https://facebook.github.io/watchman/) (for running [pyre](https://pyre-check.org/)) [**Optional**]\n- MacOS or Linux systems\n\n# Quick Installation\n\n```\ngit clone https://github.com/saltudelft/libsa4py.git\ncd libsa4py \u0026\u0026 pip install .\n```\n\n# Usage\n## Processing projects\nGiven Python repositories, run the following command to process source code files and generate JSON-formatted outputs:\n```\nlibsa4py process --p $REPOS_PATH --o $OUTPUT_PATH --d $DUPLICATE_PATH --j $WORKERS_COUNT --l $LIMIT --c --no-nlp --pyre\n```\n\nDescription:\n- `--p $REPOS_PATH`: The path to the Python corpus or dataset.\n- `--o $OUTPUT_PATH`: Path to store processed projects.\n- `--d $DUPLICATE_PATH`: Path to duplicate files of the given dataset (i.e. jsonl.gz file produced by the [CD4Py](https://github.com/saltudelft/CD4Py) tool). [**Optional**]\n- `--s`: Path to the CSV file for splitting the given dataset. [**Optional**]\n- `--j $WORKERS_COUNT`: Number of workers for processing projects. [**Optional**, default=no. of available CPU cores]\n- `--l $LIMIT`: Number of projects to be processed. [**Optional**]\n- `--c`: Whether to ignore processed projects. [**Optional**, default=False]\n- `--no-nlp`: Whether to apply standard NLP techniques to extracted identifiers. [**Optional**, default=True]\n- `--pyre`: Whether to run `pyre` to infer the types of variables for given projects. [**Optional**, default=False]\n- `--tc`: Whether to type-check type annotations in projects. [**Optional**, default=False]\n\n## Merging projects\nTo merge all the processed JSON-formatted projects into a single dataframe, run the following command:\n```\nlibsa4py merge --o $OUTPUT_PATH --l $LIMIT\n```\n\nDescription:\n- `--o $OUTPUT_PATH`: Path to the processed projects, used in the previous processing step.\n- `--l $LIMIT`: Number of projects to be merged. [**Optional**]\n\n## Applying types\nTo apply Pyre's inferred types to projects, run the following command:\n```\nlibsa4py apply --p $REPOS_PATH --o $OUTPUT_PATH\n```\n\nDescription:\n- `--p $REPOS_PATH`: The path to the Python corpus or dataset.\n- `--o $OUTPUT_PATH`: Path to the processed projects, used in the previous processing step.\n\n# JSON Output\nAfter processing each project, a JSON-formatted file is produced, which is described [here](https://github.com/saltudelft/light-sa-type-inf/blob/master/JSONOutput.md).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaltudelft%2Flibsa4py","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaltudelft%2Flibsa4py","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaltudelft%2Flibsa4py/lists"}