codebase-to-text


Namecodebase-to-text JSON
Version 1.0.6 PyPI version JSON
download
home_pagehttps://github.com/QaisarRajput/codebase_to_text
SummaryA Python package to convert codebase to text
upload_time2024-04-13 23:09:44
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 python-docx gitpython
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/37/3a/b009f1f0242884fbc11b1298d9a671c7eb60afd6308566b9fdd25dfacef3/codebase-to-text-1.0.6.tar.gz",
    "platform": null,
    "description": "# Codebase to Text Converter\r\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.\r\n\r\n\r\n\r\nConverts a codebase (folder structure with files) into a single text file or a Microsoft Word document (.docx), preserving folder structure and file contents.\r\n\r\n## Features\r\n\r\n- Supports conversion of local codebase or GitHub repositories.\r\n- Retains folder structure in a tree-like format.\r\n- Extracts file contents and metadata.\r\n- Supports multiple file types including text files (.txt) and Microsoft Word documents (.docx).\r\n\r\n## Installation\r\n\r\nYou can install the package using pip:\r\n\r\n```bash\r\npip install codebase-to-text\r\n```\r\n\r\n## Usage\r\n### Command-line Interface (CLI)\r\nYou can use the package via the command line interface (CLI):\r\n```bash\r\ncodebase-to-text --input \"path_or_github_url\" --output \"output_path\" --output_type \"txt\"\r\n```\r\n\r\n### Pythonic Way\r\nYou can also use it programmatically in your Python code:\r\n\r\n```python\r\nfrom codebase_to_text import CodebaseToText\r\n\r\ncode_to_text = CodebaseToText(input_path=\"path_or_github_url\", output_path=\"output_path\", output_type=\"txt\")\r\ncode_to_text.get_file()\r\n```\r\n\r\n### Parameters\r\n--input: Input path (local folder or GitHub URL).\r\n--output: Output file path.\r\n--output_type: Output file type (txt or docx).\r\n\r\n\r\n## Examples\r\nConvert a local codebase to a text file:\r\n```bash\r\ncodebase-to-text --input \"~/projects/my_project\" --output \"output.txt\" --output_type \"txt\"\r\n```\r\n\r\nConvert a GitHub repository to a Microsoft Word document:\r\n\r\n```bash\r\ncodebase-to-text --input \"https://github.com/username/repo_name\" --output \"output.docx\" --output_type \"docx\"\r\n```\r\n\r\n\r\n## License\r\nThis project is licensed under the MIT License - see the LICENSE file for details.\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A Python package to convert codebase to text",
    "version": "1.0.6",
    "project_urls": {
        "Download": "https://github.com/QaisarRajput/codebase_to_text/archive/refs/tags/1.0.6.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": "373ab009f1f0242884fbc11b1298d9a671c7eb60afd6308566b9fdd25dfacef3",
                "md5": "ef61f6a04690f574651e7a37fe87e0a4",
                "sha256": "ee2dd520864494bcd77afc0bb3b1137f955f5994a0cb95eb1f52e803bbe3fb50"
            },
            "downloads": -1,
            "filename": "codebase-to-text-1.0.6.tar.gz",
            "has_sig": false,
            "md5_digest": "ef61f6a04690f574651e7a37fe87e0a4",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 4480,
            "upload_time": "2024-04-13T23:09:44",
            "upload_time_iso_8601": "2024-04-13T23:09:44.151323Z",
            "url": "https://files.pythonhosted.org/packages/37/3a/b009f1f0242884fbc11b1298d9a671c7eb60afd6308566b9fdd25dfacef3/codebase-to-text-1.0.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-13 23:09:44",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "QaisarRajput",
    "github_project": "codebase_to_text",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "python-docx",
            "specs": []
        },
        {
            "name": "gitpython",
            "specs": []
        }
    ],
    "lcname": "codebase-to-text"
}
        
Elapsed time: 0.25980s