Skip to main content

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

  1. 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
  1. 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:

  1. Project structure in tree format
  2. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

project_summary-0.1.0.tar.gz (10.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

project_summary-0.1.0-py2.py3-none-any.whl (8.7 kB view details)

Uploaded Python 2Python 3

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

Hashes for project_summary-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2f568473e97c3988cd1451791a442acd36d2276daf2196902fd627c158a4517f
MD5 c3454d09611b404ed140b9401e2e4f82
BLAKE2b-256 9de164785cc86bd259ca2b41298fcc8acaf7d1018488945e46eff97ca4ee68a2

See more details on using hashes here.

File details

Details for the file project_summary-0.1.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for project_summary-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 72c9725f42f2037c9e66f58e66efe1984fa031545df911c98bb413cbfe8d3270
MD5 a6ae5741d27e1a88c3d7341db887feba
BLAKE2b-256 038d638ac12c64db62281a7c74155c94409f6dda354fa9b5dfbdd00a3bf0d721

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page