{"id":28306869,"url":"https://github.com/quentinwach/pycodar","last_synced_at":"2026-02-27T08:05:45.816Z","repository":{"id":293104684,"uuid":"982912912","full_name":"QuentinWach/PyCodar","owner":"QuentinWach","description":"Understand your Python codebase. 📡 Summarizes your directory in a single table. Displays the file structure of all the files, their functions, classes, and methods in a nicely colored tree. Shows a table of all the files with counts of the lines and much more.","archived":false,"fork":false,"pushed_at":"2025-05-15T19:09:11.000Z","size":82,"stargazers_count":14,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-27T13:52:56.267Z","etag":null,"topics":["architecture","code-structure","codebase","command-line","command-line-tool","commandline","dead-code","dead-code-removal","metadata","software-architecture","software-development","terminal","tree-structure","visualization"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/QuentinWach.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2025-05-13T15:32:50.000Z","updated_at":"2025-10-06T11:52:16.000Z","dependencies_parsed_at":"2025-05-13T18:22:23.202Z","dependency_job_id":"5e529ac5-c133-47c8-9355-300f2399d262","html_url":"https://github.com/QuentinWach/PyCodar","commit_stats":null,"previous_names":["quentinwach/pycodar"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/QuentinWach/PyCodar","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QuentinWach%2FPyCodar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QuentinWach%2FPyCodar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QuentinWach%2FPyCodar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QuentinWach%2FPyCodar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/QuentinWach","download_url":"https://codeload.github.com/QuentinWach/PyCodar/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QuentinWach%2FPyCodar/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29888149,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T07:54:54.515Z","status":"ssl_error","status_checked_at":"2026-02-27T07:54:49.177Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["architecture","code-structure","codebase","command-line","command-line-tool","commandline","dead-code","dead-code-removal","metadata","software-architecture","software-development","terminal","tree-structure","visualization"],"created_at":"2025-05-24T04:12:51.714Z","updated_at":"2026-02-27T08:05:45.811Z","avatar_url":"https://github.com/QuentinWach.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)\n![Last Commit](https://img.shields.io/github/last-commit/QuentinWach/pycodar)\n![PyPI](https://img.shields.io/pypi/v/pycodar)\n[![PyPI Downloads](https://static.pepy.tech/badge/pycodar)](https://pepy.tech/projects/pycodar)\n\n# PyCodar: A Radar for Your Code\n**A simple tool for auditing and understanding your (python) codebase.**\n\n```bash\npip install pycodar\n```\n\n+ `pycodar stats`: Summarizes the most basic stats of your directory in a single table. 📊\n+ `pycodar strct`: Displays the file structure of all the files, their functions, classes, and methods in a nicely colored tree. 🗂️\n+ `pycodar files`: Shows a table of all the files with counts of the lines of code, comments, empty lines, total lines, and file size. 📋\n+ `pycodar calls`: Counts how often elements (modules, functions, methods) of your code are called within the code. 📞\n+ `pycodar dead`: Finds (likely) unused code. ☠️\n\n\n### General Overview\nType\n```bash\npycodar stats\n```\nin your terminal to get the most basic statistics of your directory printed out:\n```bash\n📊 Basic Metrics\n╭─────────────────────┬───────────╮\n│  Total Size         │  54.21KB  │\n│  Total Files        │  6        │\n│  Total Directories  │  2        │\n│  Total Lines        │  1,394    │\n│  Code Lines         │  885      │\n│  Comment Lines      │  26       │\n│  Empty Lines        │  208      │\n│  Functions          │  38       │\n│  Classes            │  2        │\n╰─────────────────────┴───────────╯\n```\n\n### Structure\n```bash\npycodar strct\n```\ngives you something like:\n```bash\n🌳 File Structure\n📁 Root\n├── 📄 README.md\n├── 📄 pyproject.toml\n├── 📄 setup.py\n└── 📁 pycodar\n    ├── 📄 __init__.py\n    ├── 📄 analyze.py\n    │   ├── 🔷 CodeElementVisitor\n    │   │   ├── 🔹 __init__\n    │   │   ├── 🔹 visit_FunctionDef\n    │   │   ├── 🔹 visit_ClassDef\n    │   │   ├── 🔹 visit_Import\n    │   │   ├── 🔹 visit_ImportFrom\n    │   │   ├── 🔹 visit_Call\n    │   │   ├── 🔹 visit_Assign\n    │   │   ├── 🔹 visit_Name\n    │   │   ├── 🔹 visit_Attribute\n    │   │   ├── 🔹 visit_Return\n    │   │   └── 🔹 visit_Decorator\n    │   ├── 🔸 count_functions_and_classes\n    │   ├── 🔸 get_file_size_kb\n    │   ├── 🔸 count_lines\n    │   ├── 🔸 analyze_code_connections\n    │   ├── 🔸 analyze_directory\n    │   └── 🔸 generate_report\n    └── 📄 cli.py\n        ├── 🔷 TestClass\n        │   ├── 🔹 __init__\n        │   └── 🔹 test_method\n        ├── 🔸 extract_code_structure\n        ├── 🔸 create_structure_tree\n        ├── 🔸 parse_ignore_file\n        ├── 🔸 should_ignore\n        ├── 🔸 get_ignore_patterns\n        ├── 🔸 format_size\n        ├── 🔸 count_code_metrics\n        ├── 🔸 create_metrics_table\n        ├── 🔸 create_code_connections_table\n        ├── 🔸 create_dead_code_table\n        ├── 🔸 create_code_connections_tree\n        ├── 🔸 create_file_table\n        ├── 🔸 print_stats\n        ├── 🔸 print_structure\n        ├── 🔸 print_files\n        ├── 🔸 print_calls\n        ├── 🔸 print_dead_code\n        ├── 🔸 process_directory\n        └── 🔸 main\n```\n\n### File Statistics\nTyping\n```bash\npycodar files\n```\nwill give you an overview of the lines of code, comments, empty lines, total lines and file sizes:\n```bash\n📁 File Distribution\n╭───────────┬──────────────────┬────────┬────────────┬─────────┬─────────┬───────────╮\n│  Path     │  File            │  Code  │  Comments  │  Empty  │  Total  │     Size  │\n├───────────┼──────────────────┼────────┼────────────┼─────────┼─────────┼───────────┤\n│  Root     │  pyproject.toml  │     0  │         0  │      0  │     43  │   1.37KB  │\n│  Root     │  README.md       │     0  │         0  │      0  │     95  │   3.37KB  │\n│  Root     │  setup.py        │    45  │         0  │      1  │     46  │   1.72KB  │\n│  pycodar  │  __init__.py     │     7  │         1  │      3  │     11  │   0.22KB  │\n│  pycodar  │  cli.py          │   384  │        18  │     90  │    492  │  18.62KB  │\n│  pycodar  │  analyze.py      │   449  │         7  │    114  │    570  │  22.27KB  │\n╰───────────┴──────────────────┴────────┴────────────┴─────────┴─────────┴───────────╯\n```\n\n### Calls\nTo check how much the modules, functions and methods in your code are actually being used, type:\n```bash\npycondar calls\n```\nwhich will give you another table like:\n```bash\n📊 Most Called Elements\n╭────────────┬─────────────────────────┬──────────╮\n│  Type      │  Name                   │  Called  │\n├────────────┼─────────────────────────┼──────────┤\n│  Function  │  isinstance             │      28  │\n│  Function  │  print                  │      22  │\n│  Function  │  defaultdict            │      17  │\n│  Function  │  set                    │      11  │\n│  Function  │  sorted                 │      10  │\n│  Function  │  len                    │      10  │\n│  Function  │  str                    │       9  │\n│  Function  │  open                   │       7  │\n│  Function  │  Path                   │       4  │\n│  Function  │  sum                    │       4  │\n│  Method    │  console.print          │      22  │\n│  Method    │  table.add_row          │      15  │\n│  Method    │  table.add_column       │      14  │\n│  Method    │  self.generic_visit     │       8  │\n│  Method    │  ast.walk               │       5  │\n│  Method    │  subparsers.add_parser  │       5  │\n│  Method    │  ast.parse              │       4  │\n│  Method    │  tree.add               │       4  │\n│  Method    │  method.startswith      │       4  │\n│  Method    │  file.read              │       3  │\n╰────────────┴─────────────────────────┴──────────╯\n```\n\n### Dead Code\nAnd finally, to see if there is any code that's not even used, type\n```bash\n💀 Potentially Unused Code\n╭─────────┬─────────────────────────╮\n│  Type   │  Name                   │\n├─────────┼─────────────────────────┤\n│  Class  │  pycodar.cli.TestClass  │\n╰─────────┴─────────────────────────╯\n```\nwhich will point you at whatever code seems to be unused.\n\n---\n\nIf you need any help / a quick reminder, type:\n```bash\npycodar help\n```\nand if you just want to see everything all at once, type:\n```bash\npycodar all\n```\n\nThank you and enjoy! 😜","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquentinwach%2Fpycodar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fquentinwach%2Fpycodar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquentinwach%2Fpycodar/lists"}