Dependency Graph from Python imports
Project description
Carport
Dependency Graph from Python imports (CARPORT).
Installation
pip install carport
Usage
# WIP
from carport.core import ImportGraph
depg = ImportGraph(root = '..', project='carport')
# vars(depg)
ignore_nodes = ['io', 'IPython', 'pprint', 'subprocess']
dot = depg.to_dot(ignore_nodes=ignore_nodes)
dot
'digraph {\n"carport.vis";\n"carport.core";\npathlib;\nnetworkx;\nast;\ngraphviz;\nkroki;\n"carport.vis" -> "carport.core" [key=0];\npathlib -> "carport.core" [key=0];\nnetworkx -> "carport.core" [key=0];\nast -> "carport.core" [key=0];\ngraphviz -> "carport.vis" [key=0];\nkroki -> "carport.vis" [key=0];\n}\n'
dotg = depg.draw_dot(ignore_nodes=ignore_nodes)
dotg
d2 = depg.to_d2(ignore_nodes=ignore_nodes)
d2
'\n vars: { \n d2-config: { \n layout-engine: elk \n } \n }\n direction: right\n **.style.border-radius: 99\n *.style.font: mono\n \nsubprocess -> carport.vis\nIPython -> carport.vis\nast -> carport.core\npathlib -> carport.core\nnetworkx -> carport.core\nio -> carport.core\ngraphviz -> carport.vis\ncarport.vis -> carport.core\nkroki -> carport.vis\nio: null\nIPython: null\npprint: null\nsubprocess: null'
d2g = depg.draw_d2(ignore_nodes=ignore_nodes)
d2g
TODOs:
[] imports concerning __init__.py
[] py_d2
to d2 (like graphviz
to graphviz)
Related
import-deps: Github
pydeps: Github
snakefood3: Github
kroki: online editor, python-interface
D2: doc, online editor, python-interface
Statistics
Copyright
Copyright © 2024 onward Felidz. All rights reserved, with certain parts of the project specifically licensed and subject to different terms and conditions, e.g., source code of the project under the Apache-2.0 license; you may not use this project except in compliance with the license.
Citation
BibTeX citation:
@misc{felidz2024,
author = {Felidz},
title = {Carport},
year = {2024},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/felidz/carport}}
}
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 carport-0.1.1.tar.gz
.
File metadata
- Download URL: carport-0.1.1.tar.gz
- Upload date:
- Size: 11.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 22569d5ba701e7b000686837fb8c11c066d30f8bae9d10fc1467c6143d3cc861 |
|
MD5 | 498f24d9020e52b10607c19d3a515f83 |
|
BLAKE2b-256 | 62fef6cc404f997031e5e0c3688a4d8f02c19cc305663e490636114da330ced0 |
File details
Details for the file carport-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: carport-0.1.1-py3-none-any.whl
- Upload date:
- Size: 11.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9ce4f4da7803c0ad5b0293d66b4a7f3cf5de58455794fcd75717509283f8703a |
|
MD5 | 54c3d78dbee94163fa620d7337b9d519 |
|
BLAKE2b-256 | cea9705ad7e4e4e0e9ff776cb88e2cb897e2a4165cc252c8aedb50731d0050b0 |