Skip to main content

A Python module that builds a Dependency Matrix for your project.

Project description

Latest Version Development Status Download format Build Status Documentation Status Coverage Status Code Health Supported Python versions License

This Python module can build the dependency matrices of a project’s packages, based on from ... import ... commands in their modules. For now, its purpose is purely informational.

The module is composed of two classes: MatrixBuilder, which is initialized with a list of packages foundable is sys.path, and Matrix, which is an autonomous class containing matrix data. This list of packages can be a string (one package), a list of string (several) or another type of list, used to define groups of packages with a legend.

Usage

from dependenpy.utils import MatrixBuilder

myapps = (
    module1,
    module2,
    ...,
    moduleN
)

# Create an empty instance
dm = MatrixBuilder(myapps)

# Init its data with build methods
dm.build()

# You can also use separately dm.build_modules(),
# dm.build_imports() and dm.build_matrices().
# You can even chain them: dm.build_modules().build_imports().build_matrices().
# The order is important, since matrices need imports, and imports need modules.
# The build() method is just a shortcut of the above chained command.

# Print max depth of submodules and the big dictionary of imports
print dm.max_depth
print dm.imports

# Output matrix of depth 1 in CSV
dm.get_matrix(1).to_csv()

# Output matrix of maximum depth in JSON
dm.get_matrix(0).to_json()

The “other type” of list you can give to a MatrixBuilder looks like this:

my_packages = [
    'Framework', ['django'],
    'Libraries', ['dependenpy', 'django-archan'],
    'Core features', ['members', 'surveys', 'news']
    'Security layer', ['broker']
]

This way you can specify groups of packages.

Here is an example of colorized CSV output:

CSV array

This module was originally design to work in a Django project. The Django package django-archan has been built on it to display the matrices with D3JS.

Documentation

On ReadTheDocs

License

Copyright (c) 2015 Timothée Mazzucotelli

This Source Code is subject to the terms of the Mozilla Public License, v. 2.0. See the LICENSE.txt file for more details.

Thanks

Thanks to dmishin for the TSP solver, needed to compute the similarity order.

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

dependenpy-2.0.1.tar.gz (20.0 kB view details)

Uploaded Source

Built Distribution

dependenpy-2.0.1-py27.py33.py34-none-any.whl (15.3 kB view details)

Uploaded Python 2.7 Python 3.3 Python 3.4

File details

Details for the file dependenpy-2.0.1.tar.gz.

File metadata

  • Download URL: dependenpy-2.0.1.tar.gz
  • Upload date:
  • Size: 20.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for dependenpy-2.0.1.tar.gz
Algorithm Hash digest
SHA256 0c864b72887e844aabe04722dd366a4577266c34b18d1d18f705c7ff9c13b368
MD5 24a21e67b4d8cb95eeffa4fd17d75c49
BLAKE2b-256 b06d3f7fc56f392eb2237906215433a90ba2705ec3d316d35bda5bf730bc7340

See more details on using hashes here.

File details

Details for the file dependenpy-2.0.1-py27.py33.py34-none-any.whl.

File metadata

File hashes

Hashes for dependenpy-2.0.1-py27.py33.py34-none-any.whl
Algorithm Hash digest
SHA256 db967677703b0d4f1d923bd253a58383e2bb150dc1362654b8c753bb74b73622
MD5 74bcb7ce3c91a2329f78cefcf6c8517d
BLAKE2b-256 bd3b301558167c51cba526cb80e0903c3c994883d766ca8e77f0b096e408d8cf

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