Metadata-Version: 2.1
Name: carport
Version: 0.1.1
Summary: Dependency Graph from Python imports
Home-page: https://github.com/felidz/carport
Author: felidz
Author-email: cofelidz@outlook.com
License: Apache Software License 2.0
Keywords: nbdev jupyter notebook python
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: License :: OSI Approved :: Apache Software License
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: fastcore
Requires-Dist: pandas
Requires-Dist: graphviz
Requires-Dist: kroki
Requires-Dist: networkx
Provides-Extra: dev

# Carport


<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

Dependen**c**y Gr**a**ph f**r**om **P**ython imp**ort**s (CARPORT).

<!-- [![PyPI Version](https://img.shields.io/pypi/v/certx.svg?style=flat-square&color=blue)](https://pypi.org/project/certx/) 
![GitHub License](https://img.shields.io/github/license/felidz/certx.svg?style=flat-square&logo=github) -->
<!-- ![GitHub Release](https://img.shields.io/github/v/release/felidz/certx.svg?style=flat-square&logo=github) -->
<!-- ![GitHub commit activity](https://img.shields.io/github/commit-activity/t/felidz/certx.svg?style=flat-square&logo=github)
![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/felidz/certx.svg?style=flat-square&logo=github)
![GitHub top language](https://img.shields.io/github/languages/top/felidz/certx.svg?style=flat-square) -->
<!-- 
![GitHub last commit](https://img.shields.io/github/last-commit/felidz/certx.svg?style=flat-square&logo=github&color=darkgreen) 
![GitHub Actions CI Workflow Status](https://img.shields.io/github/actions/workflow/status/felidz/certx/test.yaml?style=flat-square&logo=github&label=CI)
![GitHub Actions Docs Workflow Status](https://img.shields.io/github/actions/workflow/status/felidz/certx/deploy.yaml?style=flat-square&logo=github&label=docs)
![Codecov](https://img.shields.io/codecov/c/github/felidz/certx.svg?style=flat-square&logo=codecov)
![Scrutinizer quality](https://img.shields.io/scrutinizer/quality/g/felidz/certx.svg?style=flat-square&logo=Scrutinizer) -->
<!-- ![discord](https://img.shields.io/badge/Discord?style=flat-square&logo=discord&logoColor=white) -->

## Installation

``` sh
pip install carport
```

## Usage

``` python
# WIP
from carport.core import ImportGraph

depg = ImportGraph(root = '..', project='carport')
# vars(depg)
```

``` python
ignore_nodes = ['io', 'IPython', 'pprint', 'subprocess']
```

``` python
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'

``` python
dotg = depg.draw_dot(ignore_nodes=ignore_nodes)
dotg
```

![](index_files/figure-commonmark/cell-5-output-1.svg)

``` python
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'

``` python
d2g = depg.draw_d2(ignore_nodes=ignore_nodes)
d2g
```

![](index_files/figure-commonmark/cell-7-output-1.svg)

TODOs:

\[\] imports concerning `__init__.py`

\[\] `py_d2` to d2 (like `graphviz` to graphviz)

## Related

import-deps: [Github](https://github.com/schettino72/import-deps)

pydeps: [Github](https://github.com/thebjorn/pydeps)

snakefood3: [Github](https://github.com/Trim21/snakefood3)

kroki: [online editor](https://kroki.io/),
[python-interface](https://github.com/thorwhalen/kroki)

D2: [doc](https://d2lang.com/tour/text), [online
editor](https://play.d2lang.com/),
[python-interface](https://github.com/MrBlenny/py-d2)

## Statistics

<!-- <img src="https://api.star-history.com/svg?repos=felidz/certx&type=Date" alt="drawing" width="390"/> -->

![GitHub Repo
stars](https://img.shields.io/github/stars/felidz/certx.svg?style=flat-square&logo=github)
![PyPI -
Downloads](https://img.shields.io/pypi/dm/certx.svg?style=flat-square&logo=pypi)
<!-- ![GitHub Downloads](https://img.shields.io/github/downloads/felidz/certx/total.svg?style=flat-square&logo=github) -->

## 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:

``` bibtex
@misc{felidz2024,
  author = {Felidz},
  title = {Carport},
  year = {2024},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/felidz/carport}}
}
```
