Metadata-Version: 2.1
Name: code-to-text
Version: 0.1
Summary: Extracts and combines all code from a project into a markdown or txt file.
Home-page: https://github.com/David-vanderByl/code_to_text.git
Author: David van der Byl
Author-email: your.email@example.com
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
Requires-Dist: pygments

# Code to Text

A tool to extract all code from a project into a single markdown or text file. Useful for inputting code into large language models.

## Installation

Install the package using pip:

```shell
pip install code-to-text
```

Usage
Extract code from the current directory into a file named all_code.txt:

```shell
all_code
```

Specify a directory to extract code from and a file to write the code to:


```shell
all_code --dir_path path/to/my/directory --output_path my_output_file.txt
```

Specify the file extensions to consider as code files:

```shell
all_code --code-extensions py java js cpp c rb go rs

```


Specify the files and directories to exclude:

```shell
code_extractor --exclude-files init.py setup.py --exclude-dirs .git __pycache__ dist
```


By default, code_extractor uses a set of common code file extensions, excludes a list of common files (like __init__.py and setup.py), and excludes a list of common directories (like .git and __pycache__). These defaults are defined in main.py, and you can change them by editing the file. For example, to change the default code file extensions, edit the DEFAULT_CODE_EXTENSIONS variable:

```python
DEFAULT_CODE_EXTENSIONS = ['py', 'java', 'js', 'cpp', 'c', 'rb', 'go', 'rs']
```

To change the default files to exclude, edit the DEFAULT_EXCLUDE_FILES variable:

```python
DEFAULT_EXCLUDE_FILES = ['__init__.py', 'setup.py', 'README.md']
```

And to change the default directories to exclude, edit the DEFAULT_EXCLUDE_DIRS variable:

```python
DEFAULT_EXCLUDE_DIRS = ['.git', '__pycache__', 'dist']
```


Please remember to maintain good security practices and not edit or share the `main.py` file if it contains sensitive information.
