Skip to content

standsleeping/depgraph

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

depgraph

Analyze dependencies in a Python project.

At the moment, depgraph performs three main tasks:

  1. Analyze the (nested) scopes in a Python file.
  2. Analyze certain variable assignments in a Python file.
  3. Crawl the dependency graph of a Python file.

Usage

Basic usage:

python -m depgraph <file_path>

Example:

python -m depgraph ./src/depgraph/processors/process_file.py

Options

  • file_path: Path to the Python file to analyze
  • --depth: Depth of the analysis (default: 4)
  • --log-level: Set logging level (DEBUG, INFO) (default: INFO)
  • --scope-filter: Filter output to a specific scope (e.g., '.outer.Inner.method')
  • --output-file: Write results to specified file
  • --output-format: Format for output file (JSON) (default: JSON)

Example with all options:

python -m depgraph ./src/depgraph/processors/process_file.py \
  --depth 6 \
  --log-level DEBUG \
  --scope-filter "<module>.my_function"

Output File

When using --output-file, the analysis results will be written to the specified file in JSON format, which includes:

  • Scope analysis
  • Assignment information
  • Dependency graph information
  • Import relationships

Example with output file:

python -m depgraph ./src/depgraph/processors/process_file.py \
  --log-level DEBUG \
  --output-file ./depgraph.json

About

Analyze dependencies in a Python project.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages