{"id":42445773,"url":"https://github.com/hanks/pystructure","last_synced_at":"2026-01-28T07:59:05.629Z","repository":{"id":52705281,"uuid":"83442452","full_name":"hanks/pystructure","owner":"hanks","description":"A tiny tool to help reading source code with showing structure of python source code","archived":false,"fork":false,"pushed_at":"2021-04-20T17:16:33.000Z","size":96,"stargazers_count":1,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-08-09T03:53:52.180Z","etag":null,"topics":["ast","source-reading"],"latest_commit_sha":null,"homepage":null,"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/hanks.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":"2017-02-28T14:34:11.000Z","updated_at":"2023-09-08T17:21:36.000Z","dependencies_parsed_at":"2022-08-22T09:20:11.058Z","dependency_job_id":null,"html_url":"https://github.com/hanks/pystructure","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/hanks/pystructure","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hanks%2Fpystructure","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hanks%2Fpystructure/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hanks%2Fpystructure/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hanks%2Fpystructure/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hanks","download_url":"https://codeload.github.com/hanks/pystructure/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hanks%2Fpystructure/sbom","scorecard":{"id":454589,"data":{"date":"2025-08-11","repo":{"name":"github.com/hanks/pystructure","commit":"e2e0c10c47724df5517c3c244756b733a10d9c0a"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.9,"checks":[{"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":"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":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"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":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"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":"Dangerous-Workflow","score":-1,"reason":"no workflows found","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":"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":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"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":"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: 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":"Vulnerabilities","score":1,"reason":"9 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2020-92 / GHSA-hj5v-574p-mj7c","Warn: Project is vulnerable to: PYSEC-2022-42969","Warn: Project is vulnerable to: PYSEC-2021-142 / GHSA-8q59-q68h-6hv4","Warn: Project is vulnerable to: PYSEC-2018-49 / GHSA-rprw-h62v-c2w7","Warn: Project is vulnerable to: GHSA-9hjg-9r4m-mvj7","Warn: Project is vulnerable to: GHSA-9wx4-h78v-vm56","Warn: Project is vulnerable to: PYSEC-2023-74 / GHSA-j8r2-6x86-q33q","Warn: Project is vulnerable to: PYSEC-2018-28 / GHSA-x84v-xcm2-53pg","Warn: Project is vulnerable to: PYSEC-2024-187 / GHSA-rqc4-2hc7-8c8v"],"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-19T09:13:03.888Z","repository_id":52705281,"created_at":"2025-08-19T09:13:03.888Z","updated_at":"2025-08-19T09:13:03.888Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28842833,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T07:39:25.367Z","status":"ssl_error","status_checked_at":"2026-01-28T07:39:24.487Z","response_time":57,"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","source-reading"],"created_at":"2026-01-28T07:59:04.930Z","updated_at":"2026-01-28T07:59:05.622Z","avatar_url":"https://github.com/hanks.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/hanks/pystructure.svg?branch=master)](https://travis-ci.org/hanks/pystructure)  [![Coverage Status](https://coveralls.io/repos/github/hanks/pystructure/badge.svg?branch=master)](https://coveralls.io/github/hanks/pystructure?branch=master)\n\n# pystructure\nA tiny tool to help reading source code with showing structure of python source code\n\n# Why\n\nI use PyCharm as my python IDE, and sometimes I can use `structure` navigation view to check code structure easily, like\nbelow:\n\n![structure](https://github.com/hanks/pystructure/blob/master/docs/images/pycharm-structure.jpg?raw=true)\n\nIt is useful when you read some open source codes, and for me, I like to write memo for code structure down in my note,\nbut you can not copy the structure information to text from PyCharm, so I create this tool to help me easily to output\ntext version of structure of python code.\n\n# Installation\n\n`pip install pystructure`\n\n# Usage\n\n```\n\u003e pystructure\n\nUsage:\n    pystructure.py SRC_PATH [-o FILE | --output=FILE]\n```\n\n```\n\u003e pystructure pystructure.py\n\nv __VERSION__\nc PYSymbol(object)\n  v GLOBAL_VAR\n  v FUNCTION\n  v CLASS\n  v METHOD\n  v ATTRIBUTE\n  v PRIVATE_METHOD\nc PYStructureVisitor(object)\n  v PREFIX\n  v LITERAL_VALUE_PREFIX\n  f __init__(self)\n  f visit(self, node_list)\n  f visit_Assign(self, node)\n  f visit_ClassDef(self, node)\n  f visit_FunctionDef(self, node)\n  f visit_literal_Num(self, node)\n  f visit_literal_Name(self, node)\n  f visit_literal_Str(self, node)\n  f visit_literal_List(self, node)\n  f visit_literal_Tuple(self, node)\n  f visit_literal_Dict(self, node)\n  f _get_visit_result(self, node, prefix=\"PREFIX\")\n  f _get_literal_value_list(self, node_list)\n  f _build_func_signature(self, func_name, args_list, default_list, kwarg, vararg)\n  f method_dict(self)\nc StructureParser(object)\n  f __init__(self)\n  f accept(self, visitor)\n  f load(self, src)\n  f export(self)\n  f _format_structure(self, root, level=0, output=None)\nf main()\n```\n\n# Implementation\n\n* ast - Build-in python library, to do static analytic for the source code\n* docopt - A great tool to help to create beautiful CLI for you\n\n# Contribution\n\n1. Fork the repository on GitHub, and git clone to local.\n2. Create a virtualenv and then do `pip install -r requirements.txt` from within the directory.\n3. Run the tests with running command `tox`\n   * Either use tox to build against all supported Python versions (if you have them installed) or use tox -e py{version}\n   to test against a specific version, e.g., tox -e py27 or tox -e py33.\n4. Make a branch off of master and commit your changes to it.\n5. Submit a Pull Request to the master branch on GitHub.\n\n# Licence\n\nMIT Licence\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhanks%2Fpystructure","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhanks%2Fpystructure","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhanks%2Fpystructure/lists"}