{"id":15912359,"url":"https://github.com/cdeil/pyprojectstats","last_synced_at":"2025-04-03T02:27:44.617Z","repository":{"id":142038885,"uuid":"186590709","full_name":"cdeil/pyprojectstats","owner":"cdeil","description":"Quick and simple Python project statistics","archived":false,"fork":false,"pushed_at":"2019-05-14T14:29:36.000Z","size":18,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-08T16:41:30.765Z","etag":null,"topics":["code-analysis","cython","jupyter-notebooks","python","restructuredtext"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cdeil.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":"2019-05-14T09:32:59.000Z","updated_at":"2019-05-14T14:29:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"78528a30-68b4-49fd-b253-01a36def3da2","html_url":"https://github.com/cdeil/pyprojectstats","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdeil%2Fpyprojectstats","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdeil%2Fpyprojectstats/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdeil%2Fpyprojectstats/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdeil%2Fpyprojectstats/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cdeil","download_url":"https://codeload.github.com/cdeil/pyprojectstats/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246924265,"owners_count":20855700,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["code-analysis","cython","jupyter-notebooks","python","restructuredtext"],"created_at":"2024-10-06T16:04:18.193Z","updated_at":"2025-04-03T02:27:44.585Z","avatar_url":"https://github.com/cdeil.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pyprojectstats\n\nQuick and simple Python project statistics\n\n[![Build Status](https://dev.azure.com/cdeil/pyprojectstats/_apis/build/status/cdeil.pyprojectstats?branchName=master)](https://dev.azure.com/cdeil/pyprojectstats/_build/latest?definitionId=2\u0026branchName=master)\n\n## What is this?\n\nThis is a command line application (`pyprojectstats`)\nand Python package (`import pyprojectstats`) that gives you a quick overview of a Python project.\n\n## tl;dr\n\nTo use this, just `pip install pyprojectstats` (requires Python 3.6 or later),\nand point it at a project you're interested in:\n\n```\npip install pyprojectstats\ncd /somewhere/someproject\npyprojectstats .\n```\n\n## Why?\n\nThere are many other similar tools. Why create another one?\n\nThere wasn't any that really did what I wanted. E.g. there's many line count\ntools, but they usually don't allow counting docstring lines separately\n(some count docstrings as code, some as comments), and they don't allow\ncounting lines of code in Jupyter notebooks. And there's packages to analyse\nPython code, but getting a summary on how much code, tests, docs, classes,\nfunctions, etc. is in a given Python project requires quite some expertise and scripting.\n\nThat's what `pyprojectstats` does for you - it aims to make it quick and simple to\nget an overview of any Python project.\n\nThis can be useful for a project maintainer for your own project, or as a developer\ntrying to evaluate and gauge the size of a new package you encounter.\n\nAlso: implementing this is a fun side project, where I get to try out and learn a\nfew things that are new to me: [dataclasses](https://docs.python.org/3/library/dataclasses.html),\n[flit](https://flit.readthedocs.io), [ast](https://docs.python.org/3/library/ast.html)\n\n\n## Features\n\n- Files supported: Python, Cython, Jupyter notebooks, reStructuredText (docs)\n- Count number of files in the project of each type\n- Count lines and breakdown by code, comments, blanks\n- Also more fine-grained break down, especially concerning docstrings\n- Count number of classes, functions, methods \n- Separately count code and test\n- Word and line count for documentation (both `rst` or `ipynb`)\n\nTwo modes of operation:\n\n- Command line tool for the most common tasks\n- Flexible Python API to collect, analyse and access results\n\nCurrently not planned:\n- Analyse project history (will add example how to script this, but not built-in)\n- Code quality metrics, like function length or complexity\n\n\n## Usage example\n\n### Command line tool\n\nLet's see what info we get for [black](https://github.com/python/black): \n\n```\n$ git clone https://github.com/python/black\n$ cd black\n$ pyprojectstats black\n```\n\nUse `pyprojectstats --help` to see all available options.\n\n### Python package\n\nTo use `pyprojectstats` as a Python package: \n\n```python\nimport pyprojectstats\nproject = pyprojectstats.Project(\"black\")\nproject.collect()\nproject.analyse()\nproject.report()\n```\n\nI plan to add documentation for this project. For now, you'll just have to check\nthe source code and tests if you want to see what's available.\n\n## Development \n\nDevelopment of `pyprojectstats` just started, it's not in a usable state yet.\n\n- If you have any questions, feel free to contact me\n  (https://christophdeil.com/) via Github, Twitter or Email\n- Issues with bug reports and feature requests welcome!\n- Pull requests welcome!\n\n## Other packages\n\nSome other packages and scripts that do similar things.\n\nThis is mostly a link collection for myself - I didn't look in detail at most of these yet.\n\n- https://github.com/python/black (Do they expose a tree for code analysis that includes comments?)\n- https://github.com/rubik/radon\n- https://github.com/XAMPPRocky/tokei\n- https://github.com/tonybaloney/wily\n- https://stackoverflow.com/questions/5764437/python-code-statistics\n- https://github.com/ipmb/PyMetrics\n- https://wily.readthedocs.io\n- https://github.com/tsaulic/pycount\n- https://github.com/roskakori/pygount\n- http://code.activestate.com/recipes/580709-lines-of-code-loc/\n- https://gist.github.com/quandyfactory/1671909\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdeil%2Fpyprojectstats","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcdeil%2Fpyprojectstats","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdeil%2Fpyprojectstats/lists"}