A tool to convert source code to text or docx
Project description
source-to-text-converter
A utility tool to convert the content of software codebases (local or GitHub) into a single structured text or .docx file for easy analysis, documentation, or processing.
Features
- Supports local directories and GitHub repositories as input.
- Preserves folder structure in the output.
- Outputs consolidated content as plain text or .docx.
- Option to exclude hidden files and directories.
- Verbose mode for detailed processing logs.
- File type filtering by extension.
- Robust error handling and cleanup.
Installation
pip install source-to-text-converter
Usage
CLI
source-to-text-converter --input <input_path_or_url> --output <output_file> [options]
Options:
--input(required): Local directory path or GitHub repo URL.--output(required): Output file path.--output-type(optional):txt(default) ordocx.--exclude-hidden(optional): Exclude hidden files and directories.--include-ext(optional): Comma-separated list of file extensions to include (e.g.,.py,.js).--verbose(optional): Show detailed logs.
Python API
from source_to_text_converter.source_to_text_converter import SourceToTextConverter
converter = SourceToTextConverter(
input_path="/path/to/repo",
output_path="output.txt",
output_type="txt",
exclude_hidden=True,
include_exts=[".py", ".js"],
verbose=True
)
converter.get_file()
License
Apache License 2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file source_to_text_converter-0.1.0.tar.gz.
File metadata
- Download URL: source_to_text_converter-0.1.0.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
543116e8e257263c5f2773ad2093752fe715ee77f6f833645890def19ab64449
|
|
| MD5 |
ffb27394fee5ceb8fcc70bd6f12947eb
|
|
| BLAKE2b-256 |
6c608be2f69868944c56c5d30de9aac4550d59c460da4769e6fcff0298ce5f57
|
File details
Details for the file source_to_text_converter-0.1.0-py3-none-any.whl.
File metadata
- Download URL: source_to_text_converter-0.1.0-py3-none-any.whl
- Upload date:
- Size: 2.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
567b61d98b44710d5f130f9498f5762ccb40ca2eb4f43e2b71e545b3affd0b0d
|
|
| MD5 |
169e4f366a6b5afcea8777023c8eac4a
|
|
| BLAKE2b-256 |
d0dfcfcc077817b65e9eb9d0b606e79c1c902eb8a158c19e01fcc958c27fe526
|