Giter Site home page Giter Site logo

sinoroc / deptree Goto Github PK

View Code? Open in Web Editor NEW
12.0 4.0 1.0 75 KB

Display installed Python distributions as a tree of dependencies

Home Page: https://pypi.org/project/deptree/

License: Apache License 2.0

Makefile 7.13% Python 92.87%
python python-package-management python-pip

deptree's Introduction

Introduction

Display installed Python projects as a tree of dependencies.

Features

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

Repositories

Distributions:

Source code:

Usage

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

Display installed Python projects as a tree of dependencies

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

Examples

$ deptree cryptography
cryptography==2.9  # cryptography
  cffi==1.14.0  # cffi!=1.11.3,>=1.8
    pycparser==2.20  # pycparser
  six==1.14.0  # six>=1.4.1
$ deptree --reverse cryptography
cryptography==2.9  # -
  SecretStorage==3.1.2  # cryptography
    keyring==21.2.0  # SecretStorage>=3; sys_platform == "linux"
      twine==3.1.1  # keyring>=15.1
$ deptree --flat cryptography
cffi==1.14.0
# pycparser

cryptography==2.9
# six>=1.4.1
# cffi!=1.11.3,>=1.8

pycparser==2.20

six==1.14.0
$ deptree --flat --reverse cryptography
# SecretStorage: cryptography
cryptography==2.9

# twine: keyring>=15.1
keyring==21.2.0

# keyring: SecretStorage>=3; sys_platform == "linux"
SecretStorage==3.1.2

twine==3.1.1
$ deptree CircularDependencyA
CircularDependencyA==0.0.0  # CircularDependencyA
  CircularDependencyB==0.0.0  # CircularDependencyB
    CircularDependencyA  # !!! CIRCULAR CircularDependencyA

Installation

For better comfort, use as a single-file isolated zipapp:

For example:

$ python -m pip install --target ./deptree/ deptree
$ python -m zipapp --python '/usr/bin/env python' --main 'deptree.cli:main' ./deptree/
$ mv ./deptree.pyz ~/.local/bin/deptree

Or use zapp, or toolmaker.

This way the tool can be used in virtual environments without installing it in the virtual environments. The tool can then see the projects installed in the virtual environment but without seeing itself.

Details

Similar projects

deptree's People

Contributors

sinoroc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

neutrinoceros

deptree's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.