Skip to main content

Display module dependencies

Project description

https://travis-ci.org/thebjorn/pydeps.svg https://coveralls.io/repos/thebjorn/pydeps/badge.png

Python Dependency visualization. This package installs the pydeps, and normal usage will be to use it from the command line.

To create graphs you need to install Graphviz (make sure the dot command is on your path).

This is the result of running pydeps on itself (pydeps --show pydeps):

https://dl.dropboxusercontent.com/u/94882440/pydeps.svg

pydeps also contains an Erdős-like scoring function (a.k.a. Bacon number, from Six degrees of Kevin Bacon (http://en.wikipedia.org/wiki/Six_Degrees_of_Kevin_Bacon) that lets you filter out modules that are more than a given number of ‘hops’ away from the module you’re interested in. This is useful for finding the interface a module has to the rest of the world.

To find pydeps’ interface to the Python stdlib (less some very common modules).

pydeps pydeps --show --max-bacon 2 --pylib -x os re types _* enum
https://dl.dropboxusercontent.com/u/94882440/pydeps-pylib.svg

--max-bacon 2 gives the modules that are at most 2 hops away, and modules that belong together have similar colors. Compare that to the output without the --max-bacon 2 filter:

https://dl.dropboxusercontent.com/u/94882440/pydeps-pylib-all.svg

An attempt has been made to keep the intermediate formats readable, eg. the output from pydeps --show-deps .. looks like this:

...
"pydeps.mf27": {
    "imported_by": [
        "__main__",
        "pydeps.py2depgraph"
    ],
    "kind": "imp.PY_SOURCE",
    "name": "pydeps.mf27",
    "path": "pydeps\\mf27.py"
},
"pydeps.py2depgraph": {
    "imported_by": [
        "__main__",
        "pydeps.pydeps"
    ],
    "imports": [
        "pydeps.depgraph",
        "pydeps.mf27"
    ],
    "kind": "imp.PY_SOURCE",
    "name": "pydeps.py2depgraph",
    "path": "pydeps\\py2depgraph.py"
}, ...

Usage:

usage: pydeps-script.py [-h] [-v] [-o file] [-T FORMAT] [--show] [--show-deps]
                        [--show-dot] [--debug] [--pylib] [--pylib-all]
                        [-x EXCLUDE [EXCLUDE ...]]
                        fname

positional arguments:
  fname                 filename

optional arguments:
  -h, --help            show this help message and exit
  -v, --verbose         be more verbose (-vv, -vvv for more verbosity)
  -o file               write output to 'file'
  -T FORMAT             output format (svg|png)
  --show                call external program to display graph
  --show-deps           show output of dependency analysis
  --show-dot            show output of dot conversion
  --debug               turn on all the show and verbose options
  --pylib               include python std lib modules
  --pylib-all           include python all std lib modules (incl. C modules)
  -x EXCLUDE [EXCLUDE ...], --exclude EXCLUDE [EXCLUDE ...]
                        input files to skip

You can of course import pydeps from Python (look in the tests/test_relative_imports.py file for examples.

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

pydeps-1.0.0.zip (26.6 kB view details)

Uploaded Source

Built Distributions

pydeps-1.0.0.win32.exe (259.5 kB view details)

Uploaded Source

pydeps-1.0.0-py2-none-any.whl (24.6 kB view details)

Uploaded Python 2

File details

Details for the file pydeps-1.0.0.zip.

File metadata

  • Download URL: pydeps-1.0.0.zip
  • Upload date:
  • Size: 26.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pydeps-1.0.0.zip
Algorithm Hash digest
SHA256 0b0bc71d9de83b7b34b6f26db8a80db7c791afedb95f3f1d854edfd325e400b7
MD5 8783f46796fac62139e83654dc50faad
BLAKE2b-256 8a62334f89cf0dcbf5acca3846637729172d0e4b37b4d4c995935e1ee0ea7c61

See more details on using hashes here.

Provenance

File details

Details for the file pydeps-1.0.0.win32.exe.

File metadata

  • Download URL: pydeps-1.0.0.win32.exe
  • Upload date:
  • Size: 259.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pydeps-1.0.0.win32.exe
Algorithm Hash digest
SHA256 daa0ea1f94fae4ce6d7c0f3ef8736d2cc25982b0ac64725f221d32c7ad3955be
MD5 e6cea61330e7406380154c9c77b25360
BLAKE2b-256 128e0e28a81fb76e63b65bdfd9a1023c43283067d41403b88bbb03dde598347d

See more details on using hashes here.

Provenance

File details

Details for the file pydeps-1.0.0-py2-none-any.whl.

File metadata

File hashes

Hashes for pydeps-1.0.0-py2-none-any.whl
Algorithm Hash digest
SHA256 c81cb4e898333b851a86bb1f621be919a24bc0478c5277054c0eecbd8c87597a
MD5 b50402e20aa0c403a6f4fe5dcd8c52f6
BLAKE2b-256 cd37bdb669b0d344f781514acf533605d3512954e1160d49fdbd37adc3c8ee50

See more details on using hashes here.

Provenance

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