A tool to analyze Python code complexity and style.
Project description
Pycode-Info
Pycode-Info is a Python toolkit for analyzing codebases. It provides language statistics, code complexity heatmaps, and integrates with Flake8 for linting reports. The tool is designed to help developers quickly understand the structure and quality of their code.
Features
-
Language Statistics:
Summarizes the programming languages in your project, showing file counts, total size, and line counts per language with a visual usage bar. -
Cyclomatic Complexity Viewer:
Analyzes Python files for cyclomatic complexity, highlighting complex functions and providing a heatmap of code complexity. -
Flake8 Integration:
Runs Flake8 on all Python files and summarizes errors and warnings in a readable format.
Example Outputs
Language Percentage
Code Check
Cyclomatic Complexity Viewer
Flake8 Report Example
The Flake8 report summarizes errors and warnings in your codebase:
{
"./main.py": [
{
"line_number": 5,
"column_number": 80,
"text": "line too long (115 > 79 characters)",
"code": "E501"
},
{
"line_number": 14,
"column_number": 80,
"text": "line too long (81 > 79 characters)",
"code": "E501"
}
]
}
Usage
Command Line
Run the tool from your project root:
python main.py summary # Show language statistics
python main.py heatmap # Show cyclomatic complexity heatmap for all Python files
python main.py flake8 # Run Flake8 and print a summary report
As a Module
You can also use the main features in your own scripts:
from pycode_info.lang_info import print_language_summary
from pycode_info.ccv import analyze_all_files_in_workspace
from pycode_info.flake8er import print_flake8_report
print_language_summary()
analyze_all_files_in_workspace()
print_flake8_report()
Upcoming Features
- Logical Lines: Count only lines containing code.
- Comment Lines: Count only lines containing comments.
- Hotspot Gatherer: Identify the most edited files.
- Added/Removed Lines: Track code churn.
- Cyclomatic Complexity Viewer: Enhanced visualization and reporting.
License
MIT License
Developed by Justus Decker - Copyright 2025
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pycode_info-0.1.16.tar.gz.
File metadata
- Download URL: pycode_info-0.1.16.tar.gz
- Upload date:
- Size: 10.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
764c7afc3a4819855086d4fd25b91530ad0a85e44daaac8f5bfa4d07b3e887c6
|
|
| MD5 |
96fa101d333f3b86044865767d84979f
|
|
| BLAKE2b-256 |
f3f92ee86cf5fb835284646917d863a1db3aeb8e031425a4d989749fa3d67972
|
File details
Details for the file pycode_info-0.1.16-py3-none-any.whl.
File metadata
- Download URL: pycode_info-0.1.16-py3-none-any.whl
- Upload date:
- Size: 10.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2d13429a2af9aa1520228c38462a5d77cead79cb37a9bba3e1d79c2c4d7697db
|
|
| MD5 |
4db375b86bda0dd20577c74aac411e7a
|
|
| BLAKE2b-256 |
2b94456cfa897cba0135cc1df49caf8e98cc43ddc335b4a4a764c089861f1b45
|