{"id":15348232,"url":"https://github.com/zhongjiajie/stmdency","last_synced_at":"2025-07-10T17:33:27.915Z","repository":{"id":64988857,"uuid":"580334364","full_name":"zhongjiajie/stmdency","owner":"zhongjiajie","description":"A Python library for extracting dependencies between statements","archived":false,"fork":false,"pushed_at":"2023-10-18T11:54:43.000Z","size":58,"stargazers_count":3,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-27T00:50:06.150Z","etag":null,"topics":["ast","parser","python","statement-parsers"],"latest_commit_sha":null,"homepage":"https://stmdency.rtfd.io","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/zhongjiajie.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["zhongjiajie"]}},"created_at":"2022-12-20T09:59:14.000Z","updated_at":"2023-11-16T00:14:28.000Z","dependencies_parsed_at":"2023-10-10T18:12:16.539Z","dependency_job_id":"5e659134-5dbf-44d1-b143-58232eee80ba","html_url":"https://github.com/zhongjiajie/stmdency","commit_stats":{"total_commits":19,"total_committers":1,"mean_commits":19.0,"dds":0.0,"last_synced_commit":"005c501d6de6645bd56118a13000bc1c4f56e14a"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/zhongjiajie/stmdency","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhongjiajie%2Fstmdency","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhongjiajie%2Fstmdency/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhongjiajie%2Fstmdency/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhongjiajie%2Fstmdency/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zhongjiajie","download_url":"https://codeload.github.com/zhongjiajie/stmdency/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhongjiajie%2Fstmdency/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264619648,"owners_count":23638488,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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","parser","python","statement-parsers"],"created_at":"2024-10-01T11:45:28.192Z","updated_at":"2025-07-10T17:33:26.144Z","avatar_url":"https://github.com/zhongjiajie.png","language":"Python","funding_links":["https://github.com/sponsors/zhongjiajie"],"categories":[],"sub_categories":[],"readme":"# Stmdency\n\n[![PyPi Version](https://img.shields.io/pypi/v/stmdency.svg?style=flat-square\u0026logo=PyPi)](https://pypi.org/project/stmdency/)\n[![PyPi Python Versions](https://img.shields.io/pypi/pyversions/stmdency.svg?style=flat-square\u0026logo=python)](https://pypi.org/project/stmdency/)\n[![PyPi License](https://img.shields.io/:license-Apache%202-blue.svg?style=flat-square)](https://raw.githubusercontent.com/zhongjiajie/stmdency/main/LICENSE)\n[![PyPi Status](https://img.shields.io/pypi/status/stmdency.svg?style=flat-square)](https://pypi.org/project/stmdency/)\n[![Downloads](https://pepy.tech/badge/stmdency/month)](https://pepy.tech/project/stmdency)\n[![Coverage Status](https://img.shields.io/codecov/c/github/zhongjiajie/stmdency/main.svg?style=flat-square)](https://codecov.io/github/zhongjiajie/stmdency?branch=main)  \u003c!-- markdown-link-check-disable-line --\u003e\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg?style=flat-square)](https://github.com/psf/black)\n[![CI](https://github.com/zhongjiajie/stmdency/actions/workflows/ci.yaml/badge.svg)](https://github.com/zhongjiajie/stmdency/actions/workflows/ci.yaml)\n[![Documentation Status](https://readthedocs.org/projects/stmdency/badge/?version=latest)](https://stmdency.readthedocs.io/en/latest/?badge=latest)\n\nStmdency, **ST**ate**M**ent depen**DENCY** is a Python library for extracting dependencies between Python statements.\n\n## Installation\n\n```shell\npython -m pip install --upgrade stmdency\n```\n\n## Usage\n\nLet's say we have a Python script named  `test.py` with the following content:\n\n```python\na = 1\nb = 2\n\ndef bar():\n   b = a + 3\n   print(a, b)\n\ndef foo():\n   bar(b)\n```\n\nWe want to extract function `foo` and all its dependencies. `stmdency` can do this for us:\n\n```python\nfrom stmdency.extractor import Extractor\n\nwith open(\"test.py\", \"r\") as f:\n   source = f.read()\n   extractor = Extractor(source)\n   print(extractor.get_code(\"foo\"))\n```\n\nThe output will be:\n\n```python\na = 1\n\ndef bar():\n    b = a + 3\n    print(a, b)\n\nb = 2\n\ndef foo():\n    bar(b)\n```\n\n## Documentation\n\nThe documentation host read the doc and is available at [https://stmdency.readthedocs.io](https://stmdency.readthedocs.io).\n\n## Who is using stmdency?\n\n- [dolphinscheduler-sdk-python](https://github.com/apache/dolphinscheduler-sdk-python): Python API to manage Dolphinscheduler workflow by code, aka PyDolphinscheduler.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhongjiajie%2Fstmdency","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzhongjiajie%2Fstmdency","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhongjiajie%2Fstmdency/lists"}