Skip to main content

Naive File Splitter

Naive File Splitter is a simple CLI tool to split a file into several smaller chunks at data level and merge them back. It does not compress or transform the original file in any way. NFS only reads the file in binary stream and writes it into chunks whose number or size is given by the user.

By having smaller chunks of a file instead of a large one, it allows easier and faster data download and upload, and bypasses file size limits inplaced by some cloud providers.

Naive File Splitter works with any file format.

Install

Naive File Splitter requires Python >= 3.5.

pip install nfs-estepona

Upon installation, a new nsplit binary will be added to system's path.

Command

Split

Usage

nsplit split [OPTIONS] SRC

Split the file into several chunks by specifying EITHER:

  • number of chunks with --chunk flag
  • size of each chunk with --size-per-chunk flag, and the number of chunks is calculated accordingly, i.e. 5kb, 10mb, 1gb

SRC is the filepath.

Options:

  • -c, --chunk, INTEGER, number of chunks to output
  • -s, --size, TEXT, size of each chunk

Example

Split a file into 5 chunks

nsplit split -c 5 /mnt/c/Users/estep/Videos/Captures/mgs1.mp4

$ nsplit split -c 5 /mnt/c/Users/estep/Videos/Captures/mgs1.mp4
100%|█████████████████████████████████████████████████████████████████████████████████████| 5/5 [00:00<00:00, 37.28it/s]
splitted /mnt/c/Users/estep/Videos/Captures/mgs1.mp4 into 5 chunks
Split a file into chunks of 25MB each

nsplit split -s 25mb /mnt/c/Users/estep/Videos/Captures/medium.webm

$ nsplit split -s 25mb /mnt/c/Users/estep/Videos/Captures/medium.webm
100%|███████████████████████████████████████████████████████████████████████████████████| 18/18 [00:08<00:00,  2.00it/s]
splitted /mnt/c/Users/estep/Videos/Captures/medium.webm into 18 chunks

Merge

Usage

nsplit merge [OPTIONS] SRC

Merge NFS splitted file chunks into one.

NFS splitted file chunks can be identified with .c1, .c2 (etc.) appended to the end of original file's name (path).

If multiple files that are splitted are found, user can choose which one to merge.

If the original file exists under the same directory, a new file with _copy appended to the filename will be created.

SRC is the directory path that contains (parent to) splitted file chunks.

Options:

  • -r, --remove, remove splitted file chunks after merge

Example

Merge splitted file chunks into one

nsplit merge /mnt/c/Users/estep/Videos/Captures

$ nsplit merge /mnt/c/Users/estep/Videos/Captures
100%|█████████████████████████████████████████████████████████████████████████████████████| 5/5 [00:00<00:00, 50.87it/s]
merged splitted file chunks to /mnt/c/Users/estep/Videos/Captures/mgs1_copy.mp4
Merge splitted file chunks into one and remove chunks

nsplit merge -r /mnt/c/Users/estep/Videos/Captures

$ nsplit merge -r /mnt/c/Users/estep/Videos/Captures
100%|█████████████████████████████████████████████████████████████████████████████████████| 5/5 [00:00<00:00, 49.96it/s]
merged splitted file chunks to /mnt/c/Users/estep/Videos/Captures/mgs1_copy.mp4
removed splitted file chunks
Merge splitted file chunks into one where chunks of other files exist

nsplit merge /mnt/c/Users/estep/Videos/Captures

$ nsplit merge /mnt/c/Users/estep/Videos/Captures
found 2 splitted file chunks, choose one to proceed:
1 - dup.mov
2 - mgs1.mp4
your answer: 2
100%|█████████████████████████████████████████████████████████████████████████████████████| 5/5 [00:00<00:00, 47.95it/s]
merged splitted file chunks to /mnt/c/Users/estep/Videos/Captures/mgs1_copy.mp4

Author

Binghuan Zhang - esteponawondering@gmail.com

LICENSE

MIT

Metadata

Release files for nfs-estepona 0.3.0

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

Source distribution (sdist)

Source distribution for nfs-estepona 0.3.0
File Size Uploaded
nfs_estepona-0.3.0.tar.gz 5.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nfs-estepona 0.3.0
File Interpreter ABI Platform
nfs_estepona-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 11.9 kB

Release files / nfs_estepona-0.3.0.tar.gz

Download URL nfs_estepona-0.3.0.tar.gz
Size 5.6 kB
Tags Source
SHA-256 checksum
How to use checksums
2d1af46850f63e140d1b2e167b37937ea857d48a96dce99917688670b6d99bac
BLAKE2b-256 checksum
How to use checksums
c7eab0ebf82248ba7de587545d2860b364c0707a0fada104849dd568b153707d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.11.2

Release files / nfs_estepona-0.3.0-py3-none-any.whl

Download URL nfs_estepona-0.3.0-py3-none-any.whl
Size 6.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
876e60dfa95ab18f759eb2a7b8cef6b7a829933062b8055b7365cde13301eeb8
BLAKE2b-256 checksum
How to use checksums
30750f7471997f36193bb79279caa6c26806f1ec7f704e729c559f56d0c78457
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.11.2

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

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