Skip to main content

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 split-up

Usage

Move or copy files of a folder to another, based on a predefined split ratio.

Example:

Import split-up 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 split-up 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for split-up 1.0.2
File Interpreter ABI Platform
split_up-1.0.2-py3-none-any.whl Python 3 none any Details

Release files / split_up-1.0.2-py3-none-any.whl

Download URL split_up-1.0.2-py3-none-any.whl
Size 3.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
760c5bf119221feec4c81bb4b7f4d8105d25c1e45cba411ada18a03f9c23e361
BLAKE2b-256 checksum
How to use checksums
c7832b424ace2f89035fb6b08c6a3396dab39c0b380126ae6ef8bea0466afef6
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

Release history Release notifications | RSS feed

This release

1.0.2 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page