repo-loader


Namerepo-loader JSON
Version 0.2.3 PyPI version JSON
download
home_pagehttps://github.com/cachho/repo-loader
Summaryrepository loader for github and chatgpt
upload_time2023-08-18 16:36:21
maintainercachho
docs_urlNone
author
requires_python>=3.7
licenseBSD 3-Clause License
keywords template-python-cmd
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # repo-loader

[![Linting](https://github.com/cachho/repo-loader/actions/workflows/lint.yml/badge.svg)](https://github.com/cachho/repo-loader/actions/workflows/lint.yml)
[![MacOS_Tests](https://github.com/cachho/repo-loader/actions/workflows/push_macos.yml/badge.svg)](https://github.com/cachho/repo-loader/actions/workflows/push_macos.yml)
[![Ubuntu_Tests](https://github.com/cachho/repo-loader/actions/workflows/push_ubuntu.yml/badge.svg)](https://github.com/cachho/repo-loader/actions/workflows/push_ubuntu.yml)
[![Win_Tests](https://github.com/cachho/repo-loader/actions/workflows/push_win.yml/badge.svg)](https://github.com/cachho/repo-loader/actions/workflows/push_win.yml)

This is a fork of the very excellent [gptrepo](https://github.com/zackees/gptrepo) by zackees, which itself is a fork of [gpt-repository-loader](https://github.com/mpoon/gpt-repository-loader) by mpoon.

This tool concatenates through all the files in the repo and adds ai prompts which can be used for chat gpt conversations.

Simply open up the file, copy and paste it into the chat gpt window and then ask your question about the code.

## Features

- dump entire code of github repository into a single file
- easy to split if you want to embed single files
- respect .gitignore and .gptignore
- show progress bar
- use in CLI and scripts

## Usage

### CLI

```python
pip install repo-loader
repo-loader  # now output.txt should appear in the current directory
```

### Script

```python
from repo_loader import repo_loader
repo_loader.load("example_repo")
```

### Options

| Argument                     | Type | Default                                                                                                                         | Description                                                             |
| ---------------------------- | ---- | ------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------- |
| `repo_path`                  | str  | Current directory                                                                                                               | The path to the git repository to be processed.                         |
| `out_path`                   | str  | 'output.txt'                                                                                                                    | The path to the output file.                                            |
| `preamble_file`              | str  | None                                                                                                                            | The path to a preamble file. Contents are written to output first.      |
| `preamble`                   | str  | [here](https://github.com/cachho/repo-loader/blob/f2be8ff244e85b6df640b8cd5539ed7b1b3661e0/src/repo_loader/repo_loader.py#L184) | Text that will be written to the output file before the repo contents.  |
| `clipboard`                  | bool | False                                                                                                                           | If True, output is copied to the clipboard instead of a file.           |
| `quiet`                      | bool | False                                                                                                                           | If True, the script will not print to stdout or auto-open the file.     |
| `progress`                   | bool | False                                                                                                                           | If True, the script will display a progress bar during processing.      |
| `open_file_after_processing` | bool | False                                                                                                                           | If True, the output file will be automatically opened after processing. |

## Description

`repo-loader` is a command-line and script tool that converts the contents of a Git repository into a text format, preserving the structure of the files and file contents. The generated output can be interpreted by AI language models, allowing them to process the repository's contents for various tasks, such as code review or documentation generation.

## Contributing

Some context around building this is [located here](https://github.com/mpoon/gpt-repository-loader/discussions/18). Appreciate any issues and pull requests in the spirit of having mostly GPT build out this tool. Using [ChatGPT Plus](https://chat.openai.com/) is recommended for quick access to GPT-4.

## Running Tests

To run the tests for `repo-loader`, follow these steps:

1. Ensure you have Python 3 installed on your system.
2. Navigate to the repository's root directory in your terminal.
3. Run the tests with the following command:

   ```bash
   tox
   ```

   Now, the test harness is added to the `repo-loader` project. You can run the tests by executing the command `tox` in your terminal.

## License

This project is licensed under the MIT License - see the LICENSE file for details.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/cachho/repo-loader",
    "name": "repo-loader",
    "maintainer": "cachho",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "template-python-cmd",
    "author": "",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/ef/bb/978b77c8a9c4c53d3f6bc6b7700455a00809655ebb615b6cd8d733e1d705/repo-loader-0.2.3.tar.gz",
    "platform": null,
    "description": "# repo-loader\n\n[![Linting](https://github.com/cachho/repo-loader/actions/workflows/lint.yml/badge.svg)](https://github.com/cachho/repo-loader/actions/workflows/lint.yml)\n[![MacOS_Tests](https://github.com/cachho/repo-loader/actions/workflows/push_macos.yml/badge.svg)](https://github.com/cachho/repo-loader/actions/workflows/push_macos.yml)\n[![Ubuntu_Tests](https://github.com/cachho/repo-loader/actions/workflows/push_ubuntu.yml/badge.svg)](https://github.com/cachho/repo-loader/actions/workflows/push_ubuntu.yml)\n[![Win_Tests](https://github.com/cachho/repo-loader/actions/workflows/push_win.yml/badge.svg)](https://github.com/cachho/repo-loader/actions/workflows/push_win.yml)\n\nThis is a fork of the very excellent [gptrepo](https://github.com/zackees/gptrepo) by zackees, which itself is a fork of [gpt-repository-loader](https://github.com/mpoon/gpt-repository-loader) by mpoon.\n\nThis tool concatenates through all the files in the repo and adds ai prompts which can be used for chat gpt conversations.\n\nSimply open up the file, copy and paste it into the chat gpt window and then ask your question about the code.\n\n## Features\n\n- dump entire code of github repository into a single file\n- easy to split if you want to embed single files\n- respect .gitignore and .gptignore\n- show progress bar\n- use in CLI and scripts\n\n## Usage\n\n### CLI\n\n```python\npip install repo-loader\nrepo-loader  # now output.txt should appear in the current directory\n```\n\n### Script\n\n```python\nfrom repo_loader import repo_loader\nrepo_loader.load(\"example_repo\")\n```\n\n### Options\n\n| Argument                     | Type | Default                                                                                                                         | Description                                                             |\n| ---------------------------- | ---- | ------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------- |\n| `repo_path`                  | str  | Current directory                                                                                                               | The path to the git repository to be processed.                         |\n| `out_path`                   | str  | 'output.txt'                                                                                                                    | The path to the output file.                                            |\n| `preamble_file`              | str  | None                                                                                                                            | The path to a preamble file. Contents are written to output first.      |\n| `preamble`                   | str  | [here](https://github.com/cachho/repo-loader/blob/f2be8ff244e85b6df640b8cd5539ed7b1b3661e0/src/repo_loader/repo_loader.py#L184) | Text that will be written to the output file before the repo contents.  |\n| `clipboard`                  | bool | False                                                                                                                           | If True, output is copied to the clipboard instead of a file.           |\n| `quiet`                      | bool | False                                                                                                                           | If True, the script will not print to stdout or auto-open the file.     |\n| `progress`                   | bool | False                                                                                                                           | If True, the script will display a progress bar during processing.      |\n| `open_file_after_processing` | bool | False                                                                                                                           | If True, the output file will be automatically opened after processing. |\n\n## Description\n\n`repo-loader` is a command-line and script tool that converts the contents of a Git repository into a text format, preserving the structure of the files and file contents. The generated output can be interpreted by AI language models, allowing them to process the repository's contents for various tasks, such as code review or documentation generation.\n\n## Contributing\n\nSome context around building this is [located here](https://github.com/mpoon/gpt-repository-loader/discussions/18). Appreciate any issues and pull requests in the spirit of having mostly GPT build out this tool. Using [ChatGPT Plus](https://chat.openai.com/) is recommended for quick access to GPT-4.\n\n## Running Tests\n\nTo run the tests for `repo-loader`, follow these steps:\n\n1. Ensure you have Python 3 installed on your system.\n2. Navigate to the repository's root directory in your terminal.\n3. Run the tests with the following command:\n\n   ```bash\n   tox\n   ```\n\n   Now, the test harness is added to the `repo-loader` project. You can run the tests by executing the command `tox` in your terminal.\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n",
    "bugtrack_url": null,
    "license": "BSD 3-Clause License",
    "summary": "repository loader for github and chatgpt",
    "version": "0.2.3",
    "project_urls": {
        "Homepage": "https://github.com/cachho/repo-loader"
    },
    "split_keywords": [
        "template-python-cmd"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "775bc1d89065cfd45eec52a6d3be34a791e3e78993672a57aa9ed800f82205d9",
                "md5": "83597e5a2505b6faca8e85673ddb26fc",
                "sha256": "44b02599be65894135da5cc85d3d6426ca6c099aa800b79b50953edca916a895"
            },
            "downloads": -1,
            "filename": "repo_loader-0.2.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "83597e5a2505b6faca8e85673ddb26fc",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 8360,
            "upload_time": "2023-08-18T16:36:20",
            "upload_time_iso_8601": "2023-08-18T16:36:20.167457Z",
            "url": "https://files.pythonhosted.org/packages/77/5b/c1d89065cfd45eec52a6d3be34a791e3e78993672a57aa9ed800f82205d9/repo_loader-0.2.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "efbb978b77c8a9c4c53d3f6bc6b7700455a00809655ebb615b6cd8d733e1d705",
                "md5": "3a57f17495d2268403140a04928655cc",
                "sha256": "35ed788a9b641b1e5a28ec09cd5281c68bf2c43ee1319ca31d3e6ff8c0f62550"
            },
            "downloads": -1,
            "filename": "repo-loader-0.2.3.tar.gz",
            "has_sig": false,
            "md5_digest": "3a57f17495d2268403140a04928655cc",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 13654,
            "upload_time": "2023-08-18T16:36:21",
            "upload_time_iso_8601": "2023-08-18T16:36:21.254603Z",
            "url": "https://files.pythonhosted.org/packages/ef/bb/978b77c8a9c4c53d3f6bc6b7700455a00809655ebb615b6cd8d733e1d705/repo-loader-0.2.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-18 16:36:21",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "cachho",
    "github_project": "repo-loader",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "repo-loader"
}
        
Elapsed time: 0.12105s