Skip to main content

A tool for collecting and analyzing Python project files for LLM optimization

Project description

ProjectLens 🔍

Tests codecov License: MIT

A powerful tool for collecting and analyzing coding project files for review and optimization with Large Language Models (LLMs) like ChatGPT, Claude, DeepSeek, and other AI assistants.

Overview

ProjectLens scans your codebase and creates a comprehensive text export that you can feed directly to AI models. It intelligently filters files based on extensions, respects common ignore patterns, and creates a well-formatted output that maximizes the context available to LLMs.

Features

  • 🔍 Recursively collect project files with specified extensions and smart filtering
  • 🌲 Generate detailed project tree structure
  • 📝 Create well-formatted output optimized for LLM analysis
  • 🚀 Easy to use as both CLI tool and Python API
  • 🛠️ Zero external dependencies

Installation

pip install projectlens

For development installation:

git clone https://github.com/cmcouto-silva/projectlens
cd projectlens
uv sync  # or pip install -e .

Quick Start

CLI Usage

# Basic usage - scan Python, Markdown and TOML files
projectlens /path/to/project -x py md toml

# Include specific files regardless of extension
projectlens /path/to/project -x py -i Dockerfile Makefile

# Exclude specific directories or patterns
projectlens /path/to/project -x py md -e tests *cache*

# Specify output file
projectlens /path/to/project -x py -o project_snapshot.txt

# Get detailed logs
projectlens /path/to/project -x py md -e data tests --verbose

Python API Usage

from projectlens import ProjectLens

# Initialize with file extensions to include
lens = ProjectLens(
    extensions=["py", "md", "toml"],
    include=["Dockerfile"],          # Additional files to include
    exclude=["tests", "*cache*"],    # Patterns to exclude
    max_file_size=500                # Maximum file size in KB
)

# Export the project
lens.export_project(
    folder_path="/path/to/project",
    output="project_snapshot.txt"    # Optional, auto-generated if not specified
)

Documentation

For detailed documentation, visit our documentation site.

Use Cases

  • LLM Code Review: Generate a complete snapshot of your project for AI review
  • Documentation Generation: Have AI analyze your project structure to suggest documentation
  • Knowledge Transfer: Help new team members understand project structure
  • Legacy Code Understanding: Analyze unfamiliar codebases quickly

License

This project is licensed under the MIT License - see the LICENSE file for details.

Credits

Created and maintained by Cainã Max Couto da Silva.

Donate

Like it? Consider buying me a coffee (don't forget the message) 😊

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

projectlens-0.1.1.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

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

projectlens-0.1.1-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file projectlens-0.1.1.tar.gz.

File metadata

  • Download URL: projectlens-0.1.1.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.4.30

File hashes

Hashes for projectlens-0.1.1.tar.gz
Algorithm Hash digest
SHA256 78e4ead3d55d57c67a875ad1aa841f086059a2897032a4515f29c6eaa5387dd0
MD5 4922b41c51c405ecec2bf512bab19980
BLAKE2b-256 f370d283fa66dc12cc6e212e0ac8cebc5614fa4e824d6c9b8efe1cd4934c6306

See more details on using hashes here.

File details

Details for the file projectlens-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for projectlens-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fe14caa3db2cfa47034beff1f0f34dd2b9888e54f88f5bde6bc4c0ec0ecafcf4
MD5 4ae0a97122fcc586fd4ae988a6097ff8
BLAKE2b-256 076b5a376643acc5ca1db61d4e277ef04806ada12ea54a604981b6cee52207b9

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