-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
112 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,113 @@ | ||
# Abyssal-Files-Puller | ||
Move files in deep subdirectories into single folder | ||
Move files in deep subdirectories into single folder. For example you have a bunch of files in messy directories: | ||
```bash | ||
abyssal_dir | ||
│ | ||
├── subdir0 | ||
│ ├── subdir00 | ||
│ │ ├── file21.ext | ||
│ │ ├── file22.ext | ||
│ │ └── file23.ext | ||
│ └── subdir01 | ||
│ ├── file21.ext | ||
│ ├── file22.ext | ||
│ └── file23.ext | ||
│ | ||
├── subdir1 | ||
│ ├── file21.ext | ||
│ ├── file22.ext | ||
│ └── file23.ext | ||
│ | ||
├── subdirn | ||
│ | ||
└── file_n.ext | ||
``` | ||
|
||
## Move destination | ||
The files are moved to folder called *files from abyss* which will created automatically where the script or program executed if it not available. | ||
```bash | ||
project_dir | ||
│ | ||
├── files from abyss | ||
├── other stuffs | ||
└── AFP.exe or abyss.py | ||
``` | ||
|
||
## Usage | ||
`Pull_From_Abyss(abyssal_dir, extension = 'all')` | ||
*extension can not be defined if using AFP.exe, so it would moves all found files* | ||
|
||
| Argument | Type | description | | ||
| :-- | :-- | :-- | | ||
| abyssal_dir | str | Files parent directory | | ||
| extension | str | Files extension \n default: 'all' | | ||
|
||
## Example | ||
for example the project directory is like this: | ||
```bash | ||
project_dir | ||
│ | ||
├── data | ||
│ ├── images | ||
│ │ ├── car.jpg | ||
│ │ ├── bike.jpg | ||
│ │ └── bird.jpg | ||
│ └── doc | ||
│ ├── report.pdf | ||
│ └── guide.pdf | ||
│ | ||
└── script | ||
``` | ||
|
||
### 1st example | ||
``` | ||
from abyss import Pull_From_Abyss | ||
abyssal_dir = '../project_dir/data/' | ||
Pull_From_Abyss(abysall_dir, 'jpg') | ||
``` | ||
This code will move all files ended with *jpg* to *files from abyss*, so the result would be like: | ||
```bash | ||
project_dir | ||
│ | ||
├── files from abyss | ||
│ ├── car.jpg | ||
│ ├── bike.jpg | ||
│ └── bird.jpg | ||
│ | ||
├── data | ||
│ ├── images | ||
│ └── doc | ||
│ ├── report.pdf | ||
│ └── guide.pdf | ||
│ | ||
└── script | ||
``` | ||
### 2st example | ||
``` | ||
from abyss import Pull_From_Abyss | ||
abyssal_dir = '../project_dir/data/' | ||
Pull_From_Abyss(abysall_dir) | ||
``` | ||
This code will move all files to *files from abyss*, so the result would be like: | ||
```bash | ||
project_dir | ||
│ | ||
├── files from abyss | ||
│ ├── car.jpg | ||
│ ├── bike.jpg | ||
│ ├── bird.jpg | ||
│ ├── report.pdf | ||
│ └── guide.pdf | ||
│ | ||
├── data | ||
│ ├── images | ||
│ └── doc | ||
│ | ||
└── script | ||
``` | ||
|
||
The origin directory will remain empty after operation. |