Skip to main content

Explore dependencies of a Python package by parsing its imports.

Project description

Explore dependencies of a Python package by parsing its imports.

This might be useful for:

  • seeing how modules within a package depend on each other

  • seeing which built-in libraries are relied upon

  • analysis of 3rd-party dependencies

  • etc.

Currently only tested with Python 3, against Python 3 packages.

Examples

Explore dependencies of this project:

$ pkgdeps /path/to/pkgdeps
pkgdeps
  - argparse.ArgumentParser
  - ast
  - collections.defaultdict
  - functools.reduce
  - os
  - os.path
  - sys

Usage

Various options are available to filter and format the output:

$ pkgdeps -h
usage: pkgdeps [-h] [-n <num>] [-m <num>] [-e <type> | -o <type>]
               [-f <format>]
               </path/to/package>

Explore dependencies of a package by parsing its imports.

positional arguments:
  </path/to/package>    path to package root

optional arguments:
  -h, --help            show this help message and exit
  -n <num>, --package-module-name-segments <num>
                        truncate module names of inspected package to given
                        number of segments (and consolidate imports)
  -m <num>, --dependency-module-name-segments <num>
                        truncate module names of dependencies to given number
                        of segments (and deduplicate)
  -e <type>, --exclude <type>
                        exclude various kinds of dependencies from output
                        (builtin, 3rd-party, internal)
  -o <type>, --only <type>
                        include only dependencies of the given type (builtin,
                        3rd-party, internal)
  -f <format>, --format <format>
                        graph output format (tree, tsort)

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

pkgdeps-0.0.1-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

pkgdeps-0.0.1-py2.py3-none-any.whl (6.7 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file pkgdeps-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pkgdeps-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ad134729d931a87c9efdc085b0f1da460689c987a6d7387c367d84cad0131c9f
MD5 5ca5836714fafc055743730a3b7a5f71
BLAKE2b-256 1e215a452485f99352fee756c36e2ffaf6e74bc57d4fba86af42e3836ed0d2d2

See more details on using hashes here.

File details

Details for the file pkgdeps-0.0.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for pkgdeps-0.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 522b2f6f1c353dc72254cf5e70533f5abf7fbe7ffdbe69c16c79b56fa0144ffb
MD5 e332708808bdbe7992c59d5956d1bba1
BLAKE2b-256 ffe48633bd2e6ca6bd0873157117868ac775f8860faf7efd2740fffac5fbbe3f

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