Skip to main content

Test Summarize GPT

Code Summarization Tool

This tool generates a summary of a directory's contents, including a tree view of its subdirectories and files, and the contents of each file. It can optionally exclude files listed in a .gitignore file, exclude or include Docker files, or filter files based on their extensions.

Installation

This tool can be run directly from the command line without installation. Just ensure you have Python installed and can run Python scripts. Otherwise, you can install this tool as a package using pip:

pip install summarizeGPT

Usage

To use this tool, run the following command:

SummarizeGPT <directory_path> [options]

Options:

  • <directory_path>: Path to the directory to summarize
  • --gitignore <gitignore_path>: Path to the gitignore file
  • --include <file_extensions>: Comma-separated list of file extensions to include
  • --exclude <file_extensions>: Comma-separated list of file extensions to exclude
  • -d, --show_docker: Include docker files
  • -o, --show_only_docker: Show only docker files
  • -n, --max-lines <number>: Maximum number of lines to include from each file
  • --encoding {cl100k_base,p50k_base,r50k_base}: Tiktoken encoding to use for token counting (default: cl100k_base)
  • -v, --verbose: Enable verbose output
  • -L, --max-depth <number>: Maximum directory depth to traverse for both tree and files (root=1)
  • -Lt, --tree-depth <number>: Maximum directory depth for tree view (root=1)
  • -Lf, --file-depth <number>: Maximum directory depth for file contents (root=1)

Note: On Windows the command can be case insensitive (try 'summarizegpt'), but on Linux it must be 'SummarizeGPT'.

Examples

Basic usage:

SummarizeGPT .

With gitignore:

SummarizeGPT /path/to/directory --gitignore /path/to/.gitignore

Filter by file extensions:

SummarizeGPT /path/to/directory --include py,txt
SummarizeGPT /path/to/directory --exclude xml,js

Docker-related files:

SummarizeGPT /path/to/directory -d  # Include Docker files
SummarizeGPT /path/to/directory -o  # Show only Docker files

Limit output and enable verbose logging:

SummarizeGPT /path/to/directory -n 100 -v

Limit directory depth:

SummarizeGPT /path/to/directory -L 2  # Limit both tree and file depth to 2 levels
SummarizeGPT /path/to/directory -Lt 3 -Lf 2  # Tree depth of 3, file depth of 2

Output

The tool generates a file called Context_for_ChatGPT.md in the specified directory containing:

  • A tree view of the directory structure
  • Contents of included files
  • Summary statistics including:
    • Total lines
    • Total characters
    • Total bytes
    • Approximate token count (using specified tiktoken encoding)

Limitations

  • Does not interpret file contents
  • Does not handle symbolic links
  • Large directories or files can result in large output files
  • Token counting is approximate and depends on the chosen encoding

Future Enhancements

  • AI-powered code summarization to reduce output size and improve readability
  • Support for additional file types and encodings
  • Improved handling of large files and directories

Contributing

Contributions are welcome! Feel free to submit a pull request if you've made an improvement or fixed a bug.

License

This project is licensed under the terms of the GPLv3 license.

Metadata

Release files for SummarizeGPT 1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for SummarizeGPT 1.4
File Size Uploaded Provenance Actions
summarizegpt-1.4.tar.gz 19.0 kB Without provenance Details for summarizegpt-1.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for SummarizeGPT 1.4
File Interpreter ABI Platform Actions
SummarizeGPT-1.4-py3-none-any.whl Python 3 none any Details for SummarizeGPT-1.4-py3-none-any.whl

Total release size: 39.0 kB

Release files / summarizegpt-1.4.tar.gz

Download URL summarizegpt-1.4.tar.gz
Size 19.0 kB
Tags Source
SHA-256 checksum
How to use checksums
4810a42e70f2fc55a1dc8b9bcda359000ff69d93d08c70db8b6d0d84fa0187b5
BLAKE2b-256 checksum
How to use checksums
4b77fa989ddd3552bdf020f337882b977e2bc5a6d2b2fc7f783bf32f78165d0e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.4

Release files / SummarizeGPT-1.4-py3-none-any.whl

Download URL SummarizeGPT-1.4-py3-none-any.whl
Size 20.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
43e5ac1056ac800fbcfdcfd4b7526498408c09826cf634381c2c90e85bace71b
BLAKE2b-256 checksum
How to use checksums
1ff763471238e0aa1693168a9531dfac4f59742b30d40ce71c7591fbc6d81a00
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.4

Security for SummarizeGPT 1.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page