Skip to main content

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

GitHub Repo stars PyPI - Downloads

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

carport-0.1.1.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

carport-0.1.1-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

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

Hashes for carport-0.1.1.tar.gz
Algorithm Hash digest
SHA256 22569d5ba701e7b000686837fb8c11c066d30f8bae9d10fc1467c6143d3cc861
MD5 498f24d9020e52b10607c19d3a515f83
BLAKE2b-256 62fef6cc404f997031e5e0c3688a4d8f02c19cc305663e490636114da330ced0

See more details on using hashes here.

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

Hashes for carport-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9ce4f4da7803c0ad5b0293d66b4a7f3cf5de58455794fcd75717509283f8703a
MD5 54c3d78dbee94163fa620d7337b9d519
BLAKE2b-256 cea9705ad7e4e4e0e9ff776cb88e2cb897e2a4165cc252c8aedb50731d0050b0

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