A Python module that build dependency matrices between other modules.
Project description
Dependenpy
A Python module that build dependency matrices between other modules.
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 available 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.
License
Software licensed under ISC license.
Installation
pip install dependenpy
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.
This module was originally design to work in a Django project. The Django package django-meerkat uses it to display the matrices with Highcharts.
Documentation
Development
To run all the tests: tox
Thanks
Thanks to dmishin for the TSP solver, needed to compute the similarity order.
Changelog
2.0.3 (2017-04-20)
Fix occasional UnicodeEncode when reading UTF-8 file.
Handle bad characters in files when parsing with ast.
0.1.0 to 2.0.2 (2016-10-06)
Development (alpha then beta version).
0.1.0 (2016-10-06)
Alpha release on PyPI.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file dependenpy-2.0.3.tar.gz
.
File metadata
- Download URL: dependenpy-2.0.3.tar.gz
- Upload date:
- Size: 23.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c7d0c1a6712631302855c71ce1783db9bea54023a5330fc7dc4481c4f822fdc |
|
MD5 | eee65f7b7c8a689894088f769b3f3ff6 |
|
BLAKE2b-256 | 5891c95de974d00d5a36023cb1efeedf59f6abc61ca70632a2309a34ec80709e |
File details
Details for the file dependenpy-2.0.3-py2.py3-none-any.whl
.
File metadata
- Download URL: dependenpy-2.0.3-py2.py3-none-any.whl
- Upload date:
- Size: 14.0 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09bc2d8718acb92e956a35d43dd4512d25d41df2b835adff90841a711325ca3f |
|
MD5 | 6b942b2e4c9f18e944ebb1893b146d26 |
|
BLAKE2b-256 | 869868b708ed5ae1ab913c99c16fab3f97717dc643e19a2eccc73d70f521ee0f |