Skip to main content

Display installed Python projects as a tree of dependencies

Project description

1   Introduction

Display installed Python projects as a tree of dependencies.

2   Features

  • Output compatible with requirements.txt
  • Show dependencies or dependents
  • Detect circular dependencies
  • Detect missing dependencies

3   Usage

usage: deptree [-h] [--version] [-r] [-f] [project [project ...]]

positional arguments:
  project        name of project whose dependencies (or dependents) to show

optional arguments:
  -h, --help     show this help message and exit
  --version      show program's version number and exit
  -r, --reverse  show dependent projects instead of dependencies
  -f, --flat     show flat list instead of tree

3.1   Examples

$ deptree cryptography
cryptography==2.8  # cryptography
  cffi==1.13.2  # cffi!=1.11.3,>=1.8
    pycparser==2.19  # pycparser
  six==1.13.0  # six>=1.4.1
$ deptree --reverse cryptography
cryptography==2.8  #
  SecretStorage==3.1.1  # cryptography
    keyring==21.0.0  # secretstorage; sys_platform == "linux"
      twine==3.1.1  # keyring>=15.1
$ deptree --flat cryptography
cryptography==2.8
# cffi!=1.11.3,>=1.8
# six>=1.4.1
$ deptree --flat --reverse cryptography
# secretstorage cryptography
cryptography==2.8

6   Hacking

This project makes extensive use of tox, pytest, and GNU Make.

6.1   Development environment

Use following command to create a Python virtual environment with all necessary dependencies:

tox --recreate -e develop

This creates a Python virtual environment in the .tox/develop directory. It can be activated with the following command:

. .tox/develop/bin/activate

6.2   Run test suite

In a Python virtual environment run the following command:

make review

Outside of a Python virtual environment run the following command:

tox --recreate

6.3   Build and package

In a Python virtual environment run the following command:

make package

Outside of a Python virtual environment run the following command:

tox --recreate -e package

Project details


Download files

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

Files for deptree, version 0.0.8
Filename, size File type Python version Upload date Hashes
Filename, size deptree-0.0.8-py3-none-any.whl (9.6 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size deptree-0.0.8.tar.gz (9.1 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page