https://github.com/mrqadeer/pi_folder_organizer
Python package designed to streamline the organization of files by automatically categorizing them based on their extensions. With PiFolderOrganizer, users can easily sort files into predefined or custom categories, making file management more efficient and clutter-free. The library offers flexibility in customizing file categories and extensions.
https://github.com/mrqadeer/pi_folder_organizer
automation file-management python3
Last synced: 2 months ago
JSON representation
Python package designed to streamline the organization of files by automatically categorizing them based on their extensions. With PiFolderOrganizer, users can easily sort files into predefined or custom categories, making file management more efficient and clutter-free. The library offers flexibility in customizing file categories and extensions.
- Host: GitHub
- URL: https://github.com/mrqadeer/pi_folder_organizer
- Owner: mrqadeer
- License: mit
- Created: 2024-04-08T21:15:39.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-07-05T14:14:45.000Z (11 months ago)
- Last Synced: 2025-01-28T21:16:51.531Z (4 months ago)
- Topics: automation, file-management, python3
- Language: Python
- Homepage: https://pypi.org/project/pi-folder-organizer/
- Size: 27.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# PiFolderOrganizer
PiFolderOrganizer is a Python package that helps organize files into different categories based on their file extensions.
## Installation
You can install PiFolderOrganizer using pip:
```bash
pip install pi-folder-organizer
```
## Usage
To use PiFolderOrganizer in your Python code, import the PiFolderOrganizer class:
```python
from pi_folder_organizer import PiFolderOrganizer
```
Make object of class
```python
pi_organizer=PiFolderOrganizer()
```
To continue with default cleaning:
```python
pi_organizer.pi_folder_organizer("/path/to/source_folder", "/path/to/destination_folder")
```
If you want to see which folders and extentions I use:
```python
pi_organizer.get_counter()
```
This will return you a dictionary of folders and the files list as folder's files.
Same for getting extensions
```python
pi_organizer.get_extensions()
```
This will return you a dictionary of folders and the files tuple of file's extensions.### Customization Options
You can customize the counter dictionary and extensions dictionary according to your preferences. Here's how:
```python
from pi_folder_organizer import PiFolderOrganizer# Initialize PiFolderOrganizer
pi_organizer = PiFolderOrganizer()# Customize the counter dictionary
new_counter = {
"Images": [],
"Documents": []
}# Set the new counter
pi_organizer.set_counter(new_counter)
print("Updated Counter:", pi_organizer.get_counter())# Customize the extensions dictionary
new_extensions = {
"Images": (".png", ".jpg"),
"Documents": (".txt", ".docs")
}# Set the new extensions
pi_organizer.set_extensions(new_extensions)
print("Updated Extensions:", pi_organizer.get_extensions())# Run the PiFolderOrganizer method after your setup
pi_organizer.pi_folder_organizer("source_folder", "destination_folder")
```
**Note**
The length of ```new_counter``` and ```new_extensions``` must be same. The remaining files automatically moved to folder ```Others```.### Contact Information
Feel free to reach out to me on social media:
[](https://github.com/mrqadeer)
[](https://www.linkedin.com/in/qadeer-ahmad-3499a4205/)
[](https://twitter.com/mr_sin_of_me)
[](https://web.facebook.com/mrqadeerofficial/)## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.