AiSort is a Python-based utility designed to intelligently organize files using the OpenAI ChatGPT API.
Project description
README for PCSorter
Introduction
PCSorter is a Python-based utility designed to intelligently organize files in a directory using the OpenAI ChatGPT API. This tool scans a specified directory (including subdirectories if desired), classifies files based on content and type, and reorganizes them into a more structured format. It leverages the advanced capabilities of OpenAI's GPT models to understand and categorize file contents, making file management more efficient and intuitive.
Key Features:
- File sorting using AI-driven insights.
- Customizable directory and file type handling.
- Backup and restore functionality for sorted files.
- Cross-platform compatibility with detailed setup instructions.
Requirements
- Python 3.6 or higher
openaiPython package- Additional Python libraries:
os,re,shutil,time,argparse,datetime,json,sys - An active OpenAI API key
Installation Instructions
- Ensure Python 3.6+ is installed on your system.
- Install AiSort via pip
pip install aisort - Set up an environment variable for your OpenAI API key (instructions in the next section).
Setting Up Environment Variables
Windows
- Command Prompt:
- Use
setx OPENAI_API_KEY "Your-API-Key"to set the API key.
- Use
- PowerShell:
- Apply
$env:OPENAI_API_KEY = "Your-API-Key"to set the key.
- Apply
- Editing System Properties:
- Open System Properties -> Advanced -> Environment Variables.
- Add a new System variable named
OPENAI_API_KEYwith your API key as its value.
macOS
- Using Terminal:
- Add
export OPENAI_API_KEY="Your-API-Key"to your.bash_profileor.zshrc.
- Add
- Editing
.bash_profileor.zshrc:- Open these files in a text editor and add the export line as above.
Linux
- Using Terminal:
- Similar to macOS, use
export OPENAI_API_KEY="Your-API-Key"in.bashrcor equivalent.
- Similar to macOS, use
- Editing
.bashrcor equivalent:- Open the file in an editor and add the export command.
Configuration
Before running PCSorter, ensure the OPENAI_API_KEY environment variable is set.
Usage Instructions
- Running the script:
- Execute
AiSortin your terminal. - Use command-line arguments to specify options like
--model,--dir,--include,--backup.
- Execute
- Common use cases:
- Sorting files in the current directory:
AiSort sort --dir ./my_directory - Using a specific GPT model:
AiSort sort --model gpt-3.5-turbo
- Sorting files in the current directory:
Troubleshooting
- API Key Not Recognized: Ensure the environment variable
OPENAI_API_KEYis correctly set. - Permission Errors: Run the script with appropriate permissions or from a non-restricted directory.
- Invalid Model Specified: Check that the model name is correct and supported.
FAQs
- Can PCSorter handle large directories? Yes, but performance may vary based on the number and size of files.
Contributing
Contributions to PCSorter are welcome. Please submit issues and pull requests through GitHub, adhering to the project's coding standards and guidelines.
License
PCSorter is released under the MIT License. See the LICENSE file for more details.
Acknowledgments
Thanks to the contributors and to OpenAI for the API that powers this project. Special thanks to [list any special contributors or resources].
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aisort-0.1.4.tar.gz.
File metadata
- Download URL: aisort-0.1.4.tar.gz
- Upload date:
- Size: 8.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
86b47373958b62803db9a018bfaaef1cf0bf9c70264dec6046ce63aa92773e3b
|
|
| MD5 |
b7d6deb98157aad1ec29f0879a3615ed
|
|
| BLAKE2b-256 |
ee68199cab06e53f13ece1e939d4b939e670c3e4c61b78d8be3244e2b446098a
|
File details
Details for the file aisort-0.1.4-py3-none-any.whl.
File metadata
- Download URL: aisort-0.1.4-py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
65b75f70ea21620960d193adab3a517a49f1da6ee4b36d3b45a6c9a2964b949c
|
|
| MD5 |
9ceffb4bca9394eec70e88430237569e
|
|
| BLAKE2b-256 |
c1ba0e51cf9054faa4107a0b02268bb1c592992343440743cec79da15b04744f
|