Skip to main content

Get the dependency tree of your Python virtual environment via Pip.

Project description

Pip Tree

Get the dependency tree of your Python virtual environment via Pip.

Build Status Coverage Status PyPi Licence

Showcase

There is no simple, native way to get the dependency tree of a Python virtual environment using the Pip package manager for Python. Pip Tree fixes this problem by retrieving every package from your virtual environment and returning a list of JSON objects that include the package name, version installed, date updated, and which packages are required by each package (the tree).

Install

# Install Pip Tree
pip3 install pip-tree

# Install locally
make install

Usage

Usage:
    pip-tree --path "path/to/my_project/venv/lib/python3.9/site-packages"

Options:
    -h, --help            show this help message and exit
    -p PATH, --path PATH  The path to the site-packages directory of a Python virtual environment.

Sample Output

Generating Pip Tree Report...

[
    {
        "name": "docopt",
        "version": "0.6.2",
        "updated": "2021-05-12",
        "requires": [],
        "required_by": [
            "coveralls"
        ]
    },
    {
        "name": "flake8",
        "version": "3.9.2",
        "updated": "2021-05-12",
        "requires": [
            "mccabe<0.7.0,>=0.6.0",
            "pyflakes<2.4.0,>=2.3.0",
            "pycodestyle<2.8.0,>=2.7.0"
        ],
        "required_by": []
    },
    {
        "name": "Flask",
        "version": "2.0.0",
        "updated": "2021-05-12",
        "requires": [
            "itsdangerous>=2.0",
            "click>=7.1.2",
            "Werkzeug>=2.0",
            "Jinja2>=3.0"
        ],
        "required_by": []
    }
]

Pip Tree report complete! 40 dependencies found for "path/to/my_project/venv/lib/python3.9/site-packages".

Package

In addition to the CLI tool, you can use functions to retrieve the list of packages and their details from a Python virtual environment in your own code:

import pip_tree

path = 'path/to/my_project/venv/lib/python3.9/site-packages'

package_list = pip_tree.get_pip_package_list(path)
for package in package_list:
    package_details = pip_tree.get_package_details(package)
    print(package_details['name'])

Development

# Get a comprehensive list of development tools
make help

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

pip-tree-2.0.0.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pip_tree-2.0.0-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file pip-tree-2.0.0.tar.gz.

File metadata

  • Download URL: pip-tree-2.0.0.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for pip-tree-2.0.0.tar.gz
Algorithm Hash digest
SHA256 dcf9c0607f8434da84715a49c98e10db902df5a9a8784ba3dd08d0d9bf58b86b
MD5 c7cd746bfcb9e17f61cebbea2d6fa0f8
BLAKE2b-256 0ba3a01a64869f41bd6f24ba4e768b8b5348a243ce7ea37baa7b684220cea6f8

See more details on using hashes here.

File details

Details for the file pip_tree-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: pip_tree-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for pip_tree-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1ea55a5a91d1c20ece4b2d199b6292707b5ff7250b20d9526ef4c094b31ec9bc
MD5 8f88b1f60e93423004cc692041bf1aba
BLAKE2b-256 b9004b0099f53cfa5bd868ecfa0396394766578d221539a5c2435a645f24a0d6

See more details on using hashes here.

Supported by

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