Split the files in a directory!
This package aims to let a user partition the files in a directory to folders. E.g. one could use this package to split the images of a folder into Train, Validation, and Test. The ratio and the number of splits is customizable. One could also copy the files instead of merely moving them to a different folder.
Installation
pip Install splitup
Usage
Move or copy files of a folder to another, based on a predefined split ratio.
Example:
Import splitup as sp
sp.split_custom(source_folder, destination_folder, 80, 20, copy = True)
The above code would copy the files from the source to the destination folder in 80 : 20 ratio.
Function
split_custom(source_folder, destination_folder, *p, copy = False)
Parameters
Source_folder : The path of the folder containing the files to be split. Destination_folder: The path of the folder where the directories with split files need to be stored. *p: The ratio of the split. E.g. "80,20", "70, 15, 15", "40, 20, 20, 20". The ratio must add upto 100, else an error message would be displayed. (Note: The function does not have a default split ratio.) copy: Set to 'False' by default, it could be set to 'True' in order to copy the file from the source to the destination folder insted of moving.
Output
The files would be present in "Split_(i)" folders, where i = 1, 2, 3...n, depending on the number of splits.
Release files for splitup 1.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| splitup-1.0.5-py3-none-any.whl | Python 3 | none | any | Details |
Release files / splitup-1.0.5-py3-none-any.whl
| Download URL | splitup-1.0.5-py3-none-any.whl |
|---|---|
| Size | 3.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
95b6f865122c32e7c68dfb5da31b5726a87f4c7f0e536e0f122e398897fa1eea
|
|
BLAKE2b-256 checksum How to use checksums |
cac3dbbfe2fca5071b057f58de2da5843290bd8641309241fc3e2f566fa81389
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.0
|