Metadata-Version: 2.1
Name: codebase-to-text
Version: 1.0.1
Summary: A Python package to convert codebase to text
Home-page: https://github.com/QaisarRajput/codebase_to_text
Download-URL: https://github.com/QaisarRajput/codebase_to_text/archive/refs/tags/1.0.1.tar.gz
Author: Qaisar Tanvir
Author-email: qaisartanvir.dev@gmail.com
License: MIT
Keywords: codebase, code conversion, text conversion, folder structure, file contents, text extraction, document conversion, Python package, GitHub repository, command-line tool, code analysis, file parsing, code documentation, formatting preservation, readability
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Operating System :: OS Independent
Description-Content-Type: text/markdown

# Codebase to Text Converter
For GenAI and LLM usage. This package converts codebase (folder structure with files) into a single text file or a Microsoft Word document (.docx), preserving folder structure and file contents. The tool extracts file contents from various file types, including text files, documents, and more, while retaining their formatting for easy readability.



Converts a codebase (folder structure with files) into a single text file or a Microsoft Word document (.docx), preserving folder structure and file contents.

## Features

- Supports conversion of local codebase or GitHub repositories.
- Retains folder structure in a tree-like format.
- Extracts file contents and metadata.
- Supports multiple file types including text files (.txt) and Microsoft Word documents (.docx).

## Installation

You can install the package using pip:

```bash
pip install codebase-to-text
```

## Usage
### Command-line Interface (CLI)
You can use the package via the command line interface (CLI):
```bash
codebase-to-text --input "path_or_github_url" --output "output_path" --output_type "txt"
```

### Pythonic Way
You can also use it programmatically in your Python code:

```python
from codebase_to_text import CodebaseToText

code_to_text = CodebaseToText(input_path="path_or_github_url", output_path="output_path", output_type="txt")
code_to_text.get_file()
```

### Parameters
--input: Input path (local folder or GitHub URL).
--output: Output file path.
--output_type: Output file type (txt or docx).


## Examples
Convert a local codebase to a text file:
```bash
codebase-to-text --input "~/projects/my_project" --output "output.txt" --output_type "txt"
```

Convert a GitHub repository to a Microsoft Word document:

```bash
codebase-to-text --input "https://github.com/username/repo_name" --output "output.docx" --output_type "docx"
```


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