Stmdency, STateMent depenDENCY is a Python library for extracting dependencies between Python statements.
python -m pip install --upgrade stmdency
Let's say we have a Python script named test.py
with the following content:
a = 1
b = 2
def bar():
b = a + 3
print(a, b)
def foo():
bar(b)
We want to extract function foo
and all its dependencies. stmdency
can do this for us:
from stmdency.extractor import Extractor
with open("test.py", "r") as f:
source = f.read()
extractor = Extractor(source)
print(extractor.get_code("foo"))
The output will be:
a = 1
def bar():
b = a + 3
print(a, b)
b = 2
def foo():
bar(b)
The documentation host read the doc and is available at https://stmdency.readthedocs.io.
- dolphinscheduler-sdk-python: Python API to manage Dolphinscheduler workflow by code, aka PyDolphinscheduler.