grimp 1.0b10
pip install grimp==1.0b10
Released:
Builds a graph of a Python project's internal and external dependencies.
Navigation
Unverified details
These details have not been verified by PyPIProject links
Meta
- License: BSD License (BSD 2-Clause License)
- Author: David Seddon
Classifiers
- Development Status
- Intended Audience
- License
- Operating System
- Programming Language
- Topic
Project description
Builds a graph of a Python project’s internal and external dependencies.
Free software: BSD license
Warning: This software is currently in beta. It is undergoing active development, and breaking changes may be introduced between versions.
Quick start
Install grimp:
pip install grimp
Install the Python package you wish to analyse:
pip install somepackage
In Python, build the import graph for the package:
>>> import grimp >>> graph = grimp.build_graph('somepackage')
You may now use the graph object to analyse the package. Some examples:
>>> graph.find_children('somepackage.foo') { 'somepackage.foo.one', 'somepackage.foo.two', } >>> graph.find_descendants('somepackage.foo') { 'somepackage.foo.one', 'somepackage.foo.two', 'somepackage.foo.two.blue', 'somepackage.foo.two.green', } >>> graph.find_modules_directly_imported_by('somepackage.foo') { 'somepackage.bar.one', } >>> graph.find_upstream_modules('somepackage.foo') { 'somepackage.bar.one', 'somepackage.baz', 'somepackage.foobar', } >>> graph.find_shortest_chain(importer='somepackage.foobar', imported='somepackage.foo') ( 'somepackage.foobar', 'somepackage.baz', 'somepackage.foo', ) >>> graph.get_import_details(importer='somepackage.foobar', imported='somepackage.baz')) [ { 'importer': 'somepackage.foobar', 'imported': 'somepackage.baz', 'line_number': 5, 'line_contents': 'from . import baz', }, ]
By default, external dependencies will not be included. This can be overridden like so:
>>> graph = grimp.build_graph('somepackage', include_external_packages=True) >>> graph.find_modules_directly_imported_by('somepackage.foo') { 'somepackage.bar.one', 'os', 'decimal', 'sqlalchemy', }
Project details
Unverified details
These details have not been verified by PyPIProject links
Meta
- License: BSD License (BSD 2-Clause License)
- Author: David Seddon
Classifiers
- Development Status
- Intended Audience
- License
- Operating System
- Programming Language
- Topic
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
File details
Details for the file grimp-1.0b10.tar.gz
.
File metadata
- Download URL: grimp-1.0b10.tar.gz
- Upload date:
- Size: 26.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
d452ce8ab969cb096dfbdf66f7f3f8d16559acc82a8d9508d905719a9c0e6532
|
|
MD5 |
d1d073e86cf13549a41ca462026b8da5
|
|
BLAKE2b-256 |
7cecbc43462e66d062094b77353680746da48c92822f1746f0825d55eac7accc
|