{"id":15195774,"url":"https://github.com/felidz/carport","last_synced_at":"2026-03-06T06:31:49.511Z","repository":{"id":224510804,"uuid":"763472619","full_name":"felidz/carport","owner":"felidz","description":"Dependency Graph from Python imports","archived":false,"fork":false,"pushed_at":"2024-02-26T17:07:20.000Z","size":782,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-25T12:46:17.724Z","etag":null,"topics":["dependency-graph","import-graph","import-map","python"],"latest_commit_sha":null,"homepage":"https://felidz.github.io/carport/","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/felidz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-26T11:09:10.000Z","updated_at":"2024-02-26T17:43:04.000Z","dependencies_parsed_at":"2024-09-28T00:00:52.741Z","dependency_job_id":"d452a61f-12be-4e10-8467-a6978fef9604","html_url":"https://github.com/felidz/carport","commit_stats":{"total_commits":13,"total_committers":1,"mean_commits":13.0,"dds":0.0,"last_synced_commit":"e12011ac29018809f0cf26c7fcf44186b04e6d53"},"previous_names":["felidz/carport"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/felidz/carport","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felidz%2Fcarport","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felidz%2Fcarport/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felidz%2Fcarport/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felidz%2Fcarport/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/felidz","download_url":"https://codeload.github.com/felidz/carport/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felidz%2Fcarport/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30164594,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T04:43:31.446Z","status":"ssl_error","status_checked_at":"2026-03-06T04:40:30.133Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dependency-graph","import-graph","import-map","python"],"created_at":"2024-09-28T00:00:45.487Z","updated_at":"2026-03-06T06:31:49.491Z","avatar_url":"https://github.com/felidz.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Carport\n\n\n\u003c!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! --\u003e\n\nDependen**c**y Gr**a**ph f**r**om **P**ython imp**ort**s (CARPORT).\n\n[![PyPI\nVersion](https://img.shields.io/pypi/v/carport.svg?style=flat-square\u0026color=blue)](https://pypi.org/project/carport/)\n![GitHub\nLicense](https://img.shields.io/github/license/felidz/carport.svg?style=flat-square\u0026logo=github)\n\u003c!-- ![GitHub Release](https://img.shields.io/github/v/release/felidz/carport.svg?style=flat-square\u0026logo=github) --\u003e\n![GitHub commit\nactivity](https://img.shields.io/github/commit-activity/t/felidz/carport.svg?style=flat-square\u0026logo=github)\n![GitHub code size in\nbytes](https://img.shields.io/github/languages/code-size/felidz/carport.svg?style=flat-square\u0026logo=github)\n![GitHub top\nlanguage](https://img.shields.io/github/languages/top/felidz/carport.svg?style=flat-square)\n\n![GitHub last\ncommit](https://img.shields.io/github/last-commit/felidz/carport.svg?style=flat-square\u0026logo=github\u0026color=darkgreen)\n![GitHub Actions CI Workflow\nStatus](https://img.shields.io/github/actions/workflow/status/felidz/carport/test.yaml?style=flat-square\u0026logo=github\u0026label=CI)\n![GitHub Actions Docs Workflow\nStatus](https://img.shields.io/github/actions/workflow/status/felidz/carport/deploy.yaml?style=flat-square\u0026logo=github\u0026label=docs)\n\u003c!-- ![Codecov](https://img.shields.io/codecov/c/github/felidz/carport.svg?style=flat-square\u0026logo=codecov) --\u003e\n\u003c!-- ![Scrutinizer quality](https://img.shields.io/scrutinizer/quality/g/felidz/carport.svg?style=flat-square\u0026logo=Scrutinizer) --\u003e\n\n\u003c!-- ![discord](https://img.shields.io/badge/Discord?style=flat-square\u0026logo=discord\u0026logoColor=white) --\u003e\n\n## Installation\n\n``` sh\npip install carport\n```\n\n## Usage\n\n``` python\nfrom carport.core import ImportGraph\n\ndepg = ImportGraph(root = '..', project='carport')\n# vars(depg)\n```\n\n``` python\n# specify irrelevant modules\nignore_nodes = ['io', 'IPython', 'pprint', 'subprocess']\n```\n\n``` python\n# export to dot string\ndot = depg.to_dot(ignore_nodes=ignore_nodes)\ndisplay(dot)\n```\n\n    'digraph  {\\n\"carport.vis\";\\n\"carport.core\";\\nnetworkx;\\npathlib;\\nast;\\nkroki;\\ngraphviz;\\n\"carport.vis\" -\u003e \"carport.core\"  [key=0];\\nnetworkx -\u003e \"carport.core\"  [key=0];\\npathlib -\u003e \"carport.core\"  [key=0];\\nast -\u003e \"carport.core\"  [key=0];\\nkroki -\u003e \"carport.vis\"  [key=0];\\ngraphviz -\u003e \"carport.vis\"  [key=0];\\n}\\n'\n\n``` python\n# draw graph with graphviz\ndotg = depg.draw_dot(ignore_nodes=ignore_nodes)\ndisplay(dotg)\n```\n\n![](index_files/figure-commonmark/cell-5-output-1.svg)\n\n``` python\n# export to d2 string\nd2 = depg.to_d2(ignore_nodes=ignore_nodes)\ndisplay(d2)\n```\n\n    '\\n        vars: { \\n            d2-config: { \\n                layout-engine: elk \\n                } \\n            }\\n        direction: right\\n        **.style.border-radius: 99\\n        *.style.font: mono\\n        \\npathlib -\u003e carport.core\\ngraphviz -\u003e carport.vis\\nsubprocess -\u003e carport.vis\\nast -\u003e carport.core\\ncarport.vis -\u003e carport.core\\nkroki -\u003e carport.vis\\nnetworkx -\u003e carport.core\\nio -\u003e carport.core\\nIPython -\u003e carport.vis\\nio: null\\nIPython: null\\npprint: null\\nsubprocess: null'\n\n``` python\n# draw graph with d2 or kroki\nd2g = depg.draw_d2(ignore_nodes=ignore_nodes, app='d2')\ndisplay(d2g)\n```\n\n![](index_files/figure-commonmark/cell-7-output-1.svg)\n\n``` python\n# for large graphs, you can use gravis\n#! pip install gravis\n\nimport networkx as nx \nimport gravis as gv\n\ng = depg.to_nx(ignore_nodes=ignore_nodes)\nlayout = nx.circular_layout(g, scale=4*len(g)**1.05)\nfor node_id, (x, y) in layout.items():\n    node = g.nodes[node_id]\n    node['x'], node['y'] = x, y\ngv.d3(g, edge_curvature=1, node_hover_neighborhood = True, use_edge_size_normalization=True)\n```\n\nTODOs:\n\n\\[\\] imports concerning `__init__.py`\n\n\\[\\] `py_d2` to d2 (like `graphviz` to graphviz)\n\n## Related\n\nimport-deps: [Github](https://github.com/schettino72/import-deps)\n\npydeps: [Github](https://github.com/thebjorn/pydeps)\n\nsnakefood3: [Github](https://github.com/Trim21/snakefood3)\n\nkroki: [online editor](https://kroki.io/),\n[python-interface](https://github.com/thorwhalen/kroki)\n\nD2: [doc](https://d2lang.com/tour/text), [online\neditor](https://play.d2lang.com/),\n[python-interface](https://github.com/MrBlenny/py-d2)\n\n## Statistics\n\n\u003c!-- \u003cimg src=\"https://api.star-history.com/svg?repos=felidz/carport\u0026type=Date\" alt=\"drawing\" width=\"390\"/\u003e --\u003e\n\n![GitHub Repo\nstars](https://img.shields.io/github/stars/felidz/carport.svg?style=flat-square\u0026logo=github)\n![PyPI -\nDownloads](https://img.shields.io/pypi/dm/carport.svg?style=flat-square\u0026logo=pypi)\n\u003c!-- ![GitHub Downloads](https://img.shields.io/github/downloads/felidz/carport/total.svg?style=flat-square\u0026logo=github) --\u003e\n\n## Copyright\n\nCopyright © 2024 onward Felidz. All rights reserved, with certain parts\nof the project specifically licensed and subject to different terms and\nconditions, e.g., source code of the project under the Apache-2.0\nlicense; you may not use this project except in compliance with the\nlicense.\n\n## Citation\n\nBibTeX citation:\n\n``` bibtex\n@misc{felidz2024,\n  author = {Felidz},\n  title = {Carport},\n  year = {2024},\n  publisher = {GitHub},\n  journal = {GitHub repository},\n  howpublished = {\\url{https://github.com/felidz/carport}}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffelidz%2Fcarport","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffelidz%2Fcarport","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffelidz%2Fcarport/lists"}