molddir


Namemolddir JSON
Version 0.1.5 PyPI version JSON
download
home_pagehttps://github.com/RahulDas-dev/molddir/
Summarymolddir simplifies merging directory files into a single file. It's especially useful for sending entire codebases to Large Language Models (LLMs) by encoding the codebase into one string
upload_time2024-08-26 17:09:25
maintainerRahulDas-dev
docs_urlNone
authorRahulDas-dev
requires_python<4.0,>=3.9
licenseMIT
keywords llm for coding code compression directory falttening
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # molddir: Encoder-Decoder Module

molddir is a Python package that provides a simple way to encode and decode files and directories into a custom format. This module is particularly useful in the era of Large Language Models (LLMs), where sending a complete codebase to an LLM can be a tedious task. molddir helps by encoding the entire codebase into a single string, which can then be easily decoded back into the original files and directories.

## Features
* Encoder Class: Encodes files and directories into a custom format.
* Decoder Class: Decodes the encoded data back into files and directories.
* CLI Tool: Provides a command-line interface for easy usage.
* Supports ignoring : Ignores the files/directory from repository `.gitignore` .
* Supports Incremental Encoding: Encode only the incremental changes since the last commit.
* Allows you to customize the encoding pattern using keys.py module.

# Installation
You can install molddir using Poetry:
```
poetry add molddir
```

Or using pip:
```
pip install molddir
```

# Modules

* `decoder`: Contains the `Decoder` class for decoding the codebase.
* `encoder`: Contains the `Encoder` class for encoding the codebase.
* `keys`: Contains the `KeyBuilder` class for building keys.
* `walker`: Contains the `FolderWalker` class for walking through folders.

## Using the Module
### Encoder Class

The Encoder class is responsible for encoding files and directories into a custom format. It takes in a codebase path as an argument, which can be a file or a directory.
```
from molddir import Encoder

encoder = Encoder(codebase_path = "path/to/codebase" )
encoder()
```
### Decoder Class

The Decoder class is responsible for decoding the encoded data back into files and directories.
```
from molddir import Decoder

decoder = Decoder(output_dir = "path/of/a/directory")
decoder(encoded_file = "path/to/encoded/file")
```

## Using the CLI Tool
<<<<<<< HEAD
This script `main.py` provides a command-line interface (CLI) for encoding and decoding a codebase. It supports the following functionalities:
- Encoding a codebase using the `Encoder` class.
- Decoding an encoded file using the `Decoder` class.
- Displaying the version of the tool.

### Usage

```
python main.py --encode --codebase_path <path_to_codebase>
python main.py --decode --encoded_file <path_to_encoded_file> --output_dir <output_directory>
python main.py -v | --version
=======
molddir provides a command-line interface for easy usage. Below are the available commands and their usage:

### Encoding
To encode a codebase, run:

```
molddir --encode --codebase_path <path_to_codebase> [--incremental] [--log-level <log_level>]
>>>>>>> main
```
* --encode: Encode the codebase.
* --codebase_path: Path to the codebase (file or directory) to be encoded.
* --incremental: (Optional) Enable incremental encoding.
* --log-level: (Optional) Set the logging level. Choices are DEBUG, INFO, WARNING, ERROR, CRITICAL. Default is INFO.

<<<<<<< HEAD
### Arguments
* --encode: Encode the codebase.
* --decode: Decode the codebase.
* --codebase_path: Path to the codebase to encode.
* --incremental: Enable incremental encoding (default: False)
* --encoded_file: Path to the encoded file to decode.
* --output_dir: Directory to save the decoded codebase.
* -v, --version: Display the version of the tool.

### Examples

#### Encode a Codebase
```
python main.py --encode --codebase_path /path/to/codebase
```

#### Decode an encoded file
```
python main.py --decode --encoded_file /path/to/encoded/file --output_dir /path/to/output/dir
```
#### Display the version
```
python main.py -v
=======
### Decoding
To decode the encoded data back into files and directories, run:

```
molddir --decode --encoded_file <path_to_encoded_file> --output_dir <output_directory> [--incremental] [--log-level <log_level>]
>>>>>>> main
```

* --decode: Decode the codebase.
* --encoded_file: Path to the encoded file to decode.
* --output_dir: Directory where the decoded files and directories will be saved.
* --incremental: (Optional) Enable incremental decoding.
* --log-level: (Optional) Set the logging level. Choices are DEBUG, INFO, WARNING, ERROR, CRITICAL. Default is INFO.

# Why Use molddir?
In the era of Large Language Models (LLMs), sending a complete codebase to an LLM can be a tedious task. molddir simplifies this process by encoding the entire codebase into a single string. This encoded string can then be easily sent to an LLM, and decoded back into the original files and directories when needed.

## Contributing
Contributions are welcome! Please open an issue or submit a pull request on GitHub.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/RahulDas-dev/molddir/",
    "name": "molddir",
    "maintainer": "RahulDas-dev",
    "docs_url": null,
    "requires_python": "<4.0,>=3.9",
    "maintainer_email": "r.das699@gmail.com",
    "keywords": "llm for coding, code Compression, Directory Falttening",
    "author": "RahulDas-dev",
    "author_email": "r.das699@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/95/46/4b0da6e3031144d9d498068a1e225983319497f8d35b6319010f2f6c03f9/molddir-0.1.5.tar.gz",
    "platform": null,
    "description": "# molddir: Encoder-Decoder Module\n\nmolddir is a Python package that provides a simple way to encode and decode files and directories into a custom format. This module is particularly useful in the era of Large Language Models (LLMs), where sending a complete codebase to an LLM can be a tedious task. molddir helps by encoding the entire codebase into a single string, which can then be easily decoded back into the original files and directories.\n\n## Features\n* Encoder Class: Encodes files and directories into a custom format.\n* Decoder Class: Decodes the encoded data back into files and directories.\n* CLI Tool: Provides a command-line interface for easy usage.\n* Supports ignoring : Ignores the files/directory from repository `.gitignore` .\n* Supports Incremental Encoding: Encode only the incremental changes since the last commit.\n* Allows you to customize the encoding pattern using keys.py module.\n\n# Installation\nYou can install molddir using Poetry:\n```\npoetry add molddir\n```\n\nOr using pip:\n```\npip install molddir\n```\n\n# Modules\n\n* `decoder`: Contains the `Decoder` class for decoding the codebase.\n* `encoder`: Contains the `Encoder` class for encoding the codebase.\n* `keys`: Contains the `KeyBuilder` class for building keys.\n* `walker`: Contains the `FolderWalker` class for walking through folders.\n\n## Using the Module\n### Encoder Class\n\nThe Encoder class is responsible for encoding files and directories into a custom format. It takes in a codebase path as an argument, which can be a file or a directory.\n```\nfrom molddir import Encoder\n\nencoder = Encoder(codebase_path = \"path/to/codebase\" )\nencoder()\n```\n### Decoder Class\n\nThe Decoder class is responsible for decoding the encoded data back into files and directories.\n```\nfrom molddir import Decoder\n\ndecoder = Decoder(output_dir = \"path/of/a/directory\")\ndecoder(encoded_file = \"path/to/encoded/file\")\n```\n\n## Using the CLI Tool\n<<<<<<< HEAD\nThis script `main.py` provides a command-line interface (CLI) for encoding and decoding a codebase. It supports the following functionalities:\n- Encoding a codebase using the `Encoder` class.\n- Decoding an encoded file using the `Decoder` class.\n- Displaying the version of the tool.\n\n### Usage\n\n```\npython main.py --encode --codebase_path <path_to_codebase>\npython main.py --decode --encoded_file <path_to_encoded_file> --output_dir <output_directory>\npython main.py -v | --version\n=======\nmolddir provides a command-line interface for easy usage. Below are the available commands and their usage:\n\n### Encoding\nTo encode a codebase, run:\n\n```\nmolddir --encode --codebase_path <path_to_codebase> [--incremental] [--log-level <log_level>]\n>>>>>>> main\n```\n* --encode: Encode the codebase.\n* --codebase_path: Path to the codebase (file or directory) to be encoded.\n* --incremental: (Optional) Enable incremental encoding.\n* --log-level: (Optional) Set the logging level. Choices are DEBUG, INFO, WARNING, ERROR, CRITICAL. Default is INFO.\n\n<<<<<<< HEAD\n### Arguments\n* --encode: Encode the codebase.\n* --decode: Decode the codebase.\n* --codebase_path: Path to the codebase to encode.\n* --incremental: Enable incremental encoding (default: False)\n* --encoded_file: Path to the encoded file to decode.\n* --output_dir: Directory to save the decoded codebase.\n* -v, --version: Display the version of the tool.\n\n### Examples\n\n#### Encode a Codebase\n```\npython main.py --encode --codebase_path /path/to/codebase\n```\n\n#### Decode an encoded file\n```\npython main.py --decode --encoded_file /path/to/encoded/file --output_dir /path/to/output/dir\n```\n#### Display the version\n```\npython main.py -v\n=======\n### Decoding\nTo decode the encoded data back into files and directories, run:\n\n```\nmolddir --decode --encoded_file <path_to_encoded_file> --output_dir <output_directory> [--incremental] [--log-level <log_level>]\n>>>>>>> main\n```\n\n* --decode: Decode the codebase.\n* --encoded_file: Path to the encoded file to decode.\n* --output_dir: Directory where the decoded files and directories will be saved.\n* --incremental: (Optional) Enable incremental decoding.\n* --log-level: (Optional) Set the logging level. Choices are DEBUG, INFO, WARNING, ERROR, CRITICAL. Default is INFO.\n\n# Why Use molddir?\nIn the era of Large Language Models (LLMs), sending a complete codebase to an LLM can be a tedious task. molddir simplifies this process by encoding the entire codebase into a single string. This encoded string can then be easily sent to an LLM, and decoded back into the original files and directories when needed.\n\n## Contributing\nContributions are welcome! Please open an issue or submit a pull request on GitHub.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "molddir simplifies merging directory files into a single file. It's especially useful for sending entire codebases to Large Language Models (LLMs) by encoding the codebase into one string",
    "version": "0.1.5",
    "project_urls": {
        "Documentation": "https://github.com/RahulDas-dev/molddir/",
        "Homepage": "https://github.com/RahulDas-dev/molddir/",
        "Repository": "https://github.com/RahulDas-dev/molddir/"
    },
    "split_keywords": [
        "llm for coding",
        " code compression",
        " directory falttening"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3d17ddc602f455f601c89e629d0e67fe8c79f807827ab0b924a57699cadb401e",
                "md5": "d00f929d0072586d9a9155b43f1602a7",
                "sha256": "97a8bb5638c0874b6c88debb00cfccaa14e460b0d75441d0367798aa51d89228"
            },
            "downloads": -1,
            "filename": "molddir-0.1.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d00f929d0072586d9a9155b43f1602a7",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.9",
            "size": 12263,
            "upload_time": "2024-08-26T17:09:21",
            "upload_time_iso_8601": "2024-08-26T17:09:21.977275Z",
            "url": "https://files.pythonhosted.org/packages/3d/17/ddc602f455f601c89e629d0e67fe8c79f807827ab0b924a57699cadb401e/molddir-0.1.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "95464b0da6e3031144d9d498068a1e225983319497f8d35b6319010f2f6c03f9",
                "md5": "5b7787d0e803faf94084b6bc74288a7e",
                "sha256": "fd4d8fdf9356bce48acd60655a8966f662ca96565fd9ddb529e4f35d36549409"
            },
            "downloads": -1,
            "filename": "molddir-0.1.5.tar.gz",
            "has_sig": false,
            "md5_digest": "5b7787d0e803faf94084b6bc74288a7e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 10408,
            "upload_time": "2024-08-26T17:09:25",
            "upload_time_iso_8601": "2024-08-26T17:09:25.920619Z",
            "url": "https://files.pythonhosted.org/packages/95/46/4b0da6e3031144d9d498068a1e225983319497f8d35b6319010f2f6c03f9/molddir-0.1.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-26 17:09:25",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "RahulDas-dev",
    "github_project": "molddir",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "molddir"
}
        
Elapsed time: 4.05146s