An open API service indexing awesome lists of open source software.

https://github.com/u-c4n/codecontextor

A Tkinter file/folder viewer that displays file content in Markdown and calculates token counts for LLM contexts. Built with modern Python practices (pathlib, type hints) and supports multiple languages (English, Turkish, Russian).
https://github.com/u-c4n/codecontextor

Last synced: 5 months ago
JSON representation

A Tkinter file/folder viewer that displays file content in Markdown and calculates token counts for LLM contexts. Built with modern Python practices (pathlib, type hints) and supports multiple languages (English, Turkish, Russian).

Awesome Lists containing this project

README

          

# CodeContextor v2

![CodeContextor Interface](img.jpg)

A specialized tool for preparing and sending source code to LLM chats. CodeContextor helps you scan project directories, calculate token usage, and format entire codebases for AI analysis and modifications.

## What's New in v2

- ๐Ÿš€ **Performance Optimizations**: Significantly faster processing of large markdown files
- ๐Ÿงต **Multi-threading**: Background processing prevents UI freezing during heavy operations
- ๐Ÿ’พ **Smart Caching**: Efficient caching for file contents, token counts, and directory listings
- ๐Ÿ” **Search Functionality**: Quick filtering of files and folders
- ๐Ÿ“Š **Enhanced UI**: Modern interface with better visualization and organization
- ๐ŸŒฒ **Tree View**: Improved file/folder display with type and size information
- ๐ŸŽจ **Syntax Highlighting**: Better markdown and code visualization
- โฑ๏ธ **Progress Indicators**: Visual feedback during long operations with cancellation support
- ๐Ÿ”„ **Lazy Loading**: Smart depth limiting to handle large directory structures

## Features

- ๐Ÿ” Scan and collect entire project source code
- ๐Ÿ“Š Real-time token counting for different LLM models
- ๐Ÿ“ Smart directory traversal and file filtering
- โšก Quick copy-paste to LLM chat interfaces
- ๐ŸŒ Multi-language support (English, Turkish, Russian)
- ๐Ÿ’ก Intelligent context preparation for code modifications

## Technical Stack

- Python 3.x with type hints
- Modern Python practices (pathlib, dataclasses)
- Tkinter for GUI with ttk styling
- Multi-threading for background processing
- Cache optimization strategies
- Source code parsing and formatting
- Token estimation for popular LLM models

## Installation

```bash
git clone https://github.com/yourusername/CodeContextor.git
cd CodeContextor
pip install -r requirements.txt
```

## Usage

```bash
python app.py
```

### Performance Tips

- Use the search functionality to filter large directories
- Cancel long-running operations if they're taking too long
- The application automatically limits directory depth to prevent excessive recursion
- Large files are processed in the background, allowing you to continue using the interface

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

## License

MIT License - See LICENSE file for details