Feed the contents of a folder into your ChatGPT/LLM queries faster
Project description
treefeeder
About
treefeeder
is a command-line interface (CLI) tool designed to transform a folder of files, such as code files, into a structured string. This string includes both the folder structure (in a Unix tree structure format) and the contents of the files. It's an ideal tool for feeding data into ChatGPT or other large language model (LLM) AI assistants for fine-tuning or query answering.
Installation
To install treefeeder
, simply run:
pip install treefeeder
Usage
CLI
You can use treefeeder from the command line by passing the directory path along with optional arguments for customization:
treefeeder <directory_path> [-I ignore_patterns] [-P match_patterns] [-S separator_token]
- <directory_path>: The path to the directory you want to process.
- -I ignore_patterns: Patterns to ignore files or directories.
- -P match_patterns: Patterns to match specific files.
- -S separator_token: The separator token used in output (default is [SEP]).
Python API
treefeeder can also be used within Python. To get a string output of your folder structure and file contents, use:
from treefeeder import get_output
output = get_output(directory_path, ignore_patterns=None, match_patterns=None, separator_token='[SEP]')
Example
treefeeder /path/to/my_project -I *.log -P *.py -S "[SEP]"
This command will process the 'my_project' directory, ignore .log files, match .py files, and use [SEP] as the separator token.
Contributing
Contributions are welcome! Please feel free to submit pull requests, suggest features, or report bugs.
License
treefeeder is open-source and available under MIT License.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file treefeeder-0.0.7.tar.gz
.
File metadata
- Download URL: treefeeder-0.0.7.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0c2e91b5202962d51ed29b7d68f5f944541fad0b7f4952ae538b1637d154084 |
|
MD5 | 3cf50e5161e4f1a6bfd8ac7a4a9304f2 |
|
BLAKE2b-256 | 98f11c56ca8edfe8ee06cbec7e4cb85d39ab2d22f6ae3794615b0bb7c8453ac9 |
File details
Details for the file treefeeder-0.0.7-py3-none-any.whl
.
File metadata
- Download URL: treefeeder-0.0.7-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a595b213eff34cb569fc110c193ab1b1f37407500bb82f87edc6ce3594f7d42c |
|
MD5 | 2220357f9dde44b3803efc5908359f10 |
|
BLAKE2b-256 | ba902c7faad6b297b97c2c7928d946bae68f842280e421fde4701a179806342c |