Skip to main content

Splitting files in a folder

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

splitup-1.0.5-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file splitup-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: splitup-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 3.3 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for splitup-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 95b6f865122c32e7c68dfb5da31b5726a87f4c7f0e536e0f122e398897fa1eea
MD5 e3f1e854ed1c7ae6d1798cc3cf004a34
BLAKE2b-256 cac3dbbfe2fca5071b057f58de2da5843290bd8641309241fc3e2f566fa81389

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page