Tool for generating project structure and content summaries
Project description
Project Summary Generator
A Python tool for generating comprehensive project documentation by analyzing your project's structure and files. It creates detailed summaries of your project's files and directories, making it easier to understand and document large codebases.
Features
- Tree-style visualization of project structure
- Flexible configuration using YAML
- Support for multiple directory configurations
- Intelligent file filtering by extensions
- Directory and file exclusion patterns
- Gitignore support
- Custom output naming
- File size limits
- Full file content extraction
Installation
pip install project-summary
Quick Start
- Create a configuration file
project_summary_config.yaml:
output_dir: summaries/
directories:
- path: .
extensions:
- .py
- .yml
exclude_dirs:
- __pycache__
- .git
- venv
max_file_size: 5242880 # 5MB
- Run the tool:
project-summary
Configuration Options
Basic Configuration
output_dir: summaries/ # Directory where summaries will be saved
directories: # List of directories to analyze
- path: . # Directory path (relative or absolute)
extensions: # File extensions to include
- .py
- .yml
exclude_dirs: # Directories to exclude
- __pycache__
exclude_files: # Files to exclude
- .env
max_file_size: 5242880 # Maximum file size in bytes (5MB)
output_name: my_summary # Custom name for output file (optional)
Advanced Configuration
You can specify multiple directory configurations:
output_dir: docs/summaries/
directories:
- path: src/
extensions:
- .py
exclude_dirs:
- __pycache__
output_name: backend_summary
- path: frontend/
extensions:
- .js
- .ts
- .vue
exclude_dirs:
- node_modules
files:
- package.json
output_name: frontend_summary
- path: docs/
extensions:
- .md
- .rst
output_name: documentation_summary
Command Line Options
# Use default config (project_summary_config.yaml)
project-summary
# Specify custom config file
project-summary --config my_config.yaml
# Enable verbose output
project-summary -v
Configuration Parameters
Each directory configuration supports the following parameters:
| Parameter | Type | Description | Default |
|---|---|---|---|
| path | string | Directory path to analyze | "." |
| extensions | list | File extensions to include | [] |
| files | list | Specific files to include | [] |
| dirs | list | Specific directories to include | [] |
| exclude_dirs | list | Directories to exclude | [] |
| exclude_files | list | Files to exclude | [] |
| max_file_size | int | Maximum file size in bytes | 10MB |
| output_name | string | Custom name for output file | None |
Output Format
The tool generates a text file containing:
- Project structure in tree format
- Full content of included files
Example output structure:
1. Project Structure:
├── src/
│ ├── main.py
│ └── utils.py
├── tests/
│ └── test_main.py
└── README.md
2. File Contents:
File 1: src/main.py
--------------------------------------------------
[file content here]
File 2: src/utils.py
--------------------------------------------------
[file content here]
...
Using as a Python Package
You can also use Project Summary programmatically:
from pathlib import Path
from project_summary.config import DirectoryConfig
from project_summary.core import create_project_summary
config = {
'path': '.',
'extensions': ['.py', '.md'],
'exclude_dirs': ['__pycache__'],
'max_file_size': 1048576 # 1MB
}
dir_config = DirectoryConfig(config)
create_project_summary(dir_config, Path('summaries'))
Development
To set up for development:
# Clone the repository
git clone https://github.com/fedorello/project-summary.git
cd project-summary
# Install in development mode
pip install -e .
License
MIT License
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
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 project_summary-0.1.0.tar.gz.
File metadata
- Download URL: project_summary-0.1.0.tar.gz
- Upload date:
- Size: 10.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2f568473e97c3988cd1451791a442acd36d2276daf2196902fd627c158a4517f
|
|
| MD5 |
c3454d09611b404ed140b9401e2e4f82
|
|
| BLAKE2b-256 |
9de164785cc86bd259ca2b41298fcc8acaf7d1018488945e46eff97ca4ee68a2
|
File details
Details for the file project_summary-0.1.0-py2.py3-none-any.whl.
File metadata
- Download URL: project_summary-0.1.0-py2.py3-none-any.whl
- Upload date:
- Size: 8.7 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
72c9725f42f2037c9e66f58e66efe1984fa031545df911c98bb413cbfe8d3270
|
|
| MD5 |
a6ae5741d27e1a88c3d7341db887feba
|
|
| BLAKE2b-256 |
038d638ac12c64db62281a7c74155c94409f6dda354fa9b5dfbdd00a3bf0d721
|