Gptize is a tool designed to concatenate the contents of project files for ChatGPT
Project description
GPTize
gptize is a tool for merging the contents of project files into a single text document. It is specifically designed to create datasets that can be loaded into ChatGPT for analysis or training. I, Aleksey Svetlov, created this tool because I was tired of copying file contents and paths to make GPT understand the context of my project. With gptize, this process is now automated and streamlined.
Features
- Exception handling for files based on
.gitignore
. - Support for various encodings when reading files.
- Customizable output file naming based on the input file or directory name.
- Report generation including all processed files.
Installation
To install gptize
, simply use pip:
pip install gptize
This command will install gptize
and all its dependencies. After installation, you can use gptize
from the command line anywhere.
Usage
To run gptize, you have several options:
Basic Usage
Simply invoke gptize in the command line to process the current directory:
gptize
This will process all files in the current directory and generate a report with a default name like gptize-output-folder-YYYYMMDD-HHMMSS.txt.
Specifying a Directory
To process a specific directory, use:
gptize /path/to/directory
This will process all files in the specified directory and create a report named gptize-output-folder-YYYYMMDD-HHMMSS.txt.
Specifying a Single File
For processing a single file:
gptize /path/to/file.txt
This will process only the specified file and generate a report named gptize-output-file_name-YYYYMMDD-HHMMSS.txt, where file_name is the name of the input file.
Custom Output File
If you want to specify a custom output file name, use the -o or --output option:
gptize -o custom_output.txt
This command will override the default naming convention and use custom_output.txt as the output file name.
Uploading to ChatGPT
After generating the merged file using gptize
, you can upload it to ChatGPT for improved context understanding. When making requests to ChatGPT, explicitly reference the uploaded file, for instance, using a phrase like ... based on the imported txt file.
See project file for context
This approach significantly enhances the quality of ChatGPT's responses by providing it with specific context.
Components
gptizer.py
: The main class for file processing.main.py
: The entry point of the application.models.py
: Data models for files and projects.output_builder.py
: Output constructor for report generation.settings.py
: Project settings.
Author and Maintainer
Alexey Svetlov - Creator and main maintainer.
Contact Information
License
The project is distributed under the MIT License.
CHANGELOG
[0.2.4] - 2023-11-16
- [Feature] Custom Output File Naming
- Output files now include the name of the processed file or directory, enhancing traceability and identification.
- [Enhancement] Settings Method for Custom File Names
- Updated the
Settings
class with a new method to generate output file names incorporating the name of the input file or directory.
- Updated the
- [Modification] Main File Processing Logic
- Modified
main.py
to adopt the new output file naming scheme.
- Modified
- [Fix] Minor Bug Fixes and Performance Improvements
- Addressed various minor bugs and optimized performance.
[0.2.3] - 2023-11-12
- [Enhancement] Detect binary files and handle errors gracefully
- Added binary file detection logic in load_file_content method.
- Improved error handling for file reading.
- Updated the OutputBuilder to handle binary files properly.
Project details
Release history Release notifications | RSS feed
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 gptize-0.2.4.tar.gz
.
File metadata
- Download URL: gptize-0.2.4.tar.gz
- Upload date:
- Size: 7.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 918e4ed7bea5e673941a14088c72b6edcfe64538c76ebd2769ed31be5dc6b818 |
|
MD5 | 815c4cb9c29b1defc0952040926a2e84 |
|
BLAKE2b-256 | da177a2446cc9ae055e3770f398cd19ead89bf8044600b98f1ce7cd81cea9554 |
File details
Details for the file gptize-0.2.4-py3-none-any.whl
.
File metadata
- Download URL: gptize-0.2.4-py3-none-any.whl
- Upload date:
- Size: 8.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 47f512f54130de2619637855e940d581c322bb341cb10a444e60350795a3ef84 |
|
MD5 | 1f9a3e93b33662b29bb030818c183d0b |
|
BLAKE2b-256 | 60a3bf3e701a44c4df69da8730122c8f8b194e43344a69eb3a600d59e11e29fd |