codebase-to-text


Namecodebase-to-text JSON
Version 1.0.7 PyPI version JSON
download
home_pagehttps://github.com/QaisarRajput/codebase_to_text
SummaryA Python package to convert codebase to text
upload_time2024-09-14 20:55:13
maintainerNone
docs_urlNone
authorQaisar Tanvir
requires_pythonNone
licenseMIT
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
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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.



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/QaisarRajput/codebase_to_text",
    "name": "codebase-to-text",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "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",
    "author": "Qaisar Tanvir",
    "author_email": "qaisartanvir.dev@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/47/5f/47110348181d66251035b284ef914b0885fca6521104709a044dd12ecad7/codebase_to_text-1.0.7.tar.gz",
    "platform": null,
    "description": "# Codebase to Text Converter\nFor 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.\n\n\n\nConverts a codebase (folder structure with files) into a single text file or a Microsoft Word document (.docx), preserving folder structure and file contents.\n\n## Features\n\n- Supports conversion of local codebase or GitHub repositories.\n- Retains folder structure in a tree-like format.\n- Extracts file contents and metadata.\n- Supports multiple file types including text files (.txt) and Microsoft Word documents (.docx).\n\n## Installation\n\nYou can install the package using pip:\n\n```bash\npip install codebase-to-text\n```\n\n## Usage\n### Command-line Interface (CLI)\nYou can use the package via the command line interface (CLI):\n```bash\ncodebase-to-text --input \"path_or_github_url\" --output \"output_path\" --output_type \"txt\"\n```\n\n### Pythonic Way\nYou can also use it programmatically in your Python code:\n\n```python\nfrom codebase_to_text import CodebaseToText\n\ncode_to_text = CodebaseToText(input_path=\"path_or_github_url\", output_path=\"output_path\", output_type=\"txt\")\ncode_to_text.get_file()\n```\n\n### Parameters\n--input: Input path (local folder or GitHub URL).\n--output: Output file path.\n--output_type: Output file type (txt or docx).\n\n\n## Examples\nConvert a local codebase to a text file:\n```bash\ncodebase-to-text --input \"~/projects/my_project\" --output \"output.txt\" --output_type \"txt\"\n```\n\nConvert a GitHub repository to a Microsoft Word document:\n\n```bash\ncodebase-to-text --input \"https://github.com/username/repo_name\" --output \"output.docx\" --output_type \"docx\"\n```\n\n\nLicense\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A Python package to convert codebase to text",
    "version": "1.0.7",
    "project_urls": {
        "Download": "https://github.com/QaisarRajput/codebase_to_text/archive/refs/tags/1.0.7.tar.gz",
        "Homepage": "https://github.com/QaisarRajput/codebase_to_text"
    },
    "split_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"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cfa0b6ff0cf705d757d78d9b08b299a161ffbd4c43335218205f3527ed2880b2",
                "md5": "33bcffe56265273952d32c2f92c170ce",
                "sha256": "439e0e0b6c3f5654c1febb1f41afad5bf7050101d1f3c30eb8f484270e689d0f"
            },
            "downloads": -1,
            "filename": "codebase_to_text-1.0.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "33bcffe56265273952d32c2f92c170ce",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 9704,
            "upload_time": "2024-09-14T20:55:11",
            "upload_time_iso_8601": "2024-09-14T20:55:11.848824Z",
            "url": "https://files.pythonhosted.org/packages/cf/a0/b6ff0cf705d757d78d9b08b299a161ffbd4c43335218205f3527ed2880b2/codebase_to_text-1.0.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "475f47110348181d66251035b284ef914b0885fca6521104709a044dd12ecad7",
                "md5": "fd8e25ac18c2ee09227d6a59e80d4e8d",
                "sha256": "7b0c9591528a8418adf6d3f914b5fce390f0ae8adf376782a983f98b8f32d3cd"
            },
            "downloads": -1,
            "filename": "codebase_to_text-1.0.7.tar.gz",
            "has_sig": false,
            "md5_digest": "fd8e25ac18c2ee09227d6a59e80d4e8d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 8478,
            "upload_time": "2024-09-14T20:55:13",
            "upload_time_iso_8601": "2024-09-14T20:55:13.420788Z",
            "url": "https://files.pythonhosted.org/packages/47/5f/47110348181d66251035b284ef914b0885fca6521104709a044dd12ecad7/codebase_to_text-1.0.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-14 20:55:13",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "QaisarRajput",
    "github_project": "codebase_to_text",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "codebase-to-text"
}
        
Elapsed time: 4.30235s