gexp


Namegexp JSON
Version 1.0.0 PyPI version JSON
download
home_pageNone
SummaryA simple CLI to export whole directories into a single string with .gitignore support and more.
upload_time2025-01-31 14:36:22
maintainerNone
docs_urlNone
authorNone
requires_pythonNone
licenseMIT License Copyright (c) 2025 Gusarich Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords export files gitignore cli
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # gexp

**gexp** is a CLI tool to recursively export text files from a directory, while respecting `.gitignore`, allowing filtering via include/exclude patterns, limiting file size, and displaying the top N largest extracted files.

## Features

-   **Respects `.gitignore`** – Automatically skips files and directories listed in `.gitignore`.
-   **Recursive Export** – Scans all subdirectories and includes files matching criteria.
-   **Include/Exclude Filtering** – Use patterns to specify which files should be included or excluded.
-   **File Size Limit** – Skip files larger than a specified size.
-   **Binary File Detection** – Automatically skips binary files.
-   **Top-N Largest Files Listing** – Always prints the N largest extracted files to the console.
-   **Output to File** – Optionally write the extracted contents to a file.

## Installation

Install `gexp` from PyPI:

```bash
pip install gexp
```

## Usage

### Basic Usage

To export all text files from the current directory:

```bash
gexp
```

### Specify a Directory

To export from a specific directory:

```bash
gexp /path/to/directory
```

### Write Output to a File

To write the extracted files' content to a file instead of printing:

```bash
gexp -o output.txt
```

### Limit File Size

To skip files larger than 500 KB:

```bash
gexp --max-size 500000
```

### Filter by Name

```bash
gexp --include "*.py"
```

### Exclude Specific Directories or Files

To exclude all files in the `docs/` directory:

```bash
gexp --exclude "docs/**"
```

### Combine Include and Exclude

To export only `.py` files while excluding test files:

```bash
gexp --include "*.py" --exclude "test_*.py"
```

### Show Top N Largest Extracted Files

To print the **5 largest** extracted files:

```bash
gexp --top-n 5
```

### Full Example

Export only `.md` and `.txt` files, exclude the `node_modules/` folder, limit file size to 1 MB, and save output to `export.md`:

```bash
gexp --include "*.md" --include "*.txt" --exclude "node_modules/**" --max-size 1000000 -o export.md
```

## Changelog

See [CHANGELOG.md](CHANGELOG.md) for more details.

## License

This project is licensed under the **MIT License**.

---

Happy exporting! 🚀

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "gexp",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "export, files, gitignore, cli",
    "author": null,
    "author_email": "Gusarich <gusarich@icloud.com>",
    "download_url": "https://files.pythonhosted.org/packages/89/1a/c345513852de35ebb63d460478931fb1ea140b7b175b57b724b7d9a63f51/gexp-1.0.0.tar.gz",
    "platform": null,
    "description": "# gexp\n\n**gexp** is a CLI tool to recursively export text files from a directory, while respecting `.gitignore`, allowing filtering via include/exclude patterns, limiting file size, and displaying the top N largest extracted files.\n\n## Features\n\n-   **Respects `.gitignore`** \u2013 Automatically skips files and directories listed in `.gitignore`.\n-   **Recursive Export** \u2013 Scans all subdirectories and includes files matching criteria.\n-   **Include/Exclude Filtering** \u2013 Use patterns to specify which files should be included or excluded.\n-   **File Size Limit** \u2013 Skip files larger than a specified size.\n-   **Binary File Detection** \u2013 Automatically skips binary files.\n-   **Top-N Largest Files Listing** \u2013 Always prints the N largest extracted files to the console.\n-   **Output to File** \u2013 Optionally write the extracted contents to a file.\n\n## Installation\n\nInstall `gexp` from PyPI:\n\n```bash\npip install gexp\n```\n\n## Usage\n\n### Basic Usage\n\nTo export all text files from the current directory:\n\n```bash\ngexp\n```\n\n### Specify a Directory\n\nTo export from a specific directory:\n\n```bash\ngexp /path/to/directory\n```\n\n### Write Output to a File\n\nTo write the extracted files' content to a file instead of printing:\n\n```bash\ngexp -o output.txt\n```\n\n### Limit File Size\n\nTo skip files larger than 500 KB:\n\n```bash\ngexp --max-size 500000\n```\n\n### Filter by Name\n\n```bash\ngexp --include \"*.py\"\n```\n\n### Exclude Specific Directories or Files\n\nTo exclude all files in the `docs/` directory:\n\n```bash\ngexp --exclude \"docs/**\"\n```\n\n### Combine Include and Exclude\n\nTo export only `.py` files while excluding test files:\n\n```bash\ngexp --include \"*.py\" --exclude \"test_*.py\"\n```\n\n### Show Top N Largest Extracted Files\n\nTo print the **5 largest** extracted files:\n\n```bash\ngexp --top-n 5\n```\n\n### Full Example\n\nExport only `.md` and `.txt` files, exclude the `node_modules/` folder, limit file size to 1 MB, and save output to `export.md`:\n\n```bash\ngexp --include \"*.md\" --include \"*.txt\" --exclude \"node_modules/**\" --max-size 1000000 -o export.md\n```\n\n## Changelog\n\nSee [CHANGELOG.md](CHANGELOG.md) for more details.\n\n## License\n\nThis project is licensed under the **MIT License**.\n\n---\n\nHappy exporting! \ud83d\ude80\n",
    "bugtrack_url": null,
    "license": "MIT License\n        \n        Copyright (c) 2025 Gusarich\n        \n        Permission is hereby granted, free of charge, to any person obtaining a copy\n        of this software and associated documentation files (the \"Software\"), to deal\n        in the Software without restriction, including without limitation the rights\n        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n        copies of the Software, and to permit persons to whom the Software is\n        furnished to do so, subject to the following conditions:\n        \n        The above copyright notice and this permission notice shall be included in all\n        copies or substantial portions of the Software.\n        \n        THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n        SOFTWARE.\n        ",
    "summary": "A simple CLI to export whole directories into a single string with .gitignore support and more.",
    "version": "1.0.0",
    "project_urls": {
        "Homepage": "https://github.com/Gusarich/gexp",
        "Issues": "https://github.com/Gusarich/gexp/issues"
    },
    "split_keywords": [
        "export",
        " files",
        " gitignore",
        " cli"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "da6a7fd6652f92ecb1def2a65c62d7a30fd8be11a906050488449603e2ee37fe",
                "md5": "774315ab3f4f596b8d29550456145c84",
                "sha256": "bfbae006f12c2591e13a09a46f770300f346cb0061912bd6015d00253c796b49"
            },
            "downloads": -1,
            "filename": "gexp-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "774315ab3f4f596b8d29550456145c84",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 6444,
            "upload_time": "2025-01-31T14:36:19",
            "upload_time_iso_8601": "2025-01-31T14:36:19.614077Z",
            "url": "https://files.pythonhosted.org/packages/da/6a/7fd6652f92ecb1def2a65c62d7a30fd8be11a906050488449603e2ee37fe/gexp-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "891ac345513852de35ebb63d460478931fb1ea140b7b175b57b724b7d9a63f51",
                "md5": "1af3891d5e5e0c534123557ba71699eb",
                "sha256": "f92cd3d9b8e290682325e9275d66ceeaa2108e5e99562564ea6d7a7d288f1ead"
            },
            "downloads": -1,
            "filename": "gexp-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "1af3891d5e5e0c534123557ba71699eb",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 5468,
            "upload_time": "2025-01-31T14:36:22",
            "upload_time_iso_8601": "2025-01-31T14:36:22.921516Z",
            "url": "https://files.pythonhosted.org/packages/89/1a/c345513852de35ebb63d460478931fb1ea140b7b175b57b724b7d9a63f51/gexp-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-31 14:36:22",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Gusarich",
    "github_project": "gexp",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "gexp"
}
        
Elapsed time: 1.85104s