Skip to main content

A library extracting dependencies between statements in Python program.

Project description

Stmdency

PyPi Version PyPi Python Versions PyPi License PyPi Status Downloads Coverage Status Code style: black Imports: isort CI Documentation Status

stmdency, statement dependency is a Python library for extracting dependencies between statements in a Python program.

Installation

python -m pip install --upgrade stmdency

Usage

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)

Documentation

The documentation host read the doc and is available at https://stmdency.readthedocs.io.

Who is using stmdency?

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stmdency-0.0.5.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

stmdency-0.0.5-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file stmdency-0.0.5.tar.gz.

File metadata

  • Download URL: stmdency-0.0.5.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for stmdency-0.0.5.tar.gz
Algorithm Hash digest
SHA256 3c938f391953ed4df6def0a136b6079c19cd5d0d0aa488d9f2d5efcfcd1b2e97
MD5 f9a6f58b3786a35ce264815b705601d6
BLAKE2b-256 7c635e0c0a0e8f1a3c31152fbaa5f0f251978f0345c2ec274541412629832235

See more details on using hashes here.

File details

Details for the file stmdency-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: stmdency-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for stmdency-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 11ed3d627aab9e8a84d6f574b2b5b7f8a9192ffd1a8bc30714717bcd8d8d0a58
MD5 20802025a32fd5986b13613927c02193
BLAKE2b-256 4fef9d44b0c5ded4b1252c24b641fd6f2219eb62e4e89a093b1a14fe906f13bc

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page