<div align=center>
<h1>Naive File Splitter</h1>
<img src="https://img.shields.io/badge/nfs--estepona-0.2.*-blue"/>
<img src="https://img.shields.io/badge/python->=3.5-blueviolet"/>
<img src="https://img.shields.io/badge/click-7.0-brightgreen"/>
<img src="./assets/banner.png">
</div>
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`
```bash
$ 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`
```bash
$ 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`
```bash
$ 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`
```bash
$ 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`
```bash
$ 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](https://github.com/estepona) - esteponawondering@gmail.com
## LICENSE
MIT
Raw data
{
"_id": null,
"home_page": "https://github.com/estepona/naive-file-splitter",
"name": "nfs-estepona",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.5",
"maintainer_email": null,
"keywords": "CLI, file, split, utility",
"author": "Binghuan Zhang",
"author_email": "esteponawondering@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/c7/ea/b0ebf82248ba7de587545d2860b364c0707a0fada104849dd568b153707d/nfs_estepona-0.3.0.tar.gz",
"platform": null,
"description": "<div align=center>\r\n <h1>Naive File Splitter</h1>\r\n <img src=\"https://img.shields.io/badge/nfs--estepona-0.2.*-blue\"/>\r\n <img src=\"https://img.shields.io/badge/python->=3.5-blueviolet\"/>\r\n <img src=\"https://img.shields.io/badge/click-7.0-brightgreen\"/>\r\n <img src=\"./assets/banner.png\">\r\n</div>\r\n\r\nNaive 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.\r\n\r\nBy 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.\r\n\r\nNaive File Splitter works with *any* file format.\r\n\r\n## Install\r\n\r\nNaive File Splitter requires *Python >= 3.5*.\r\n\r\n`pip install nfs-estepona`\r\n\r\nUpon installation, a new `nsplit` binary will be added to system's path.\r\n\r\n## Command\r\n\r\n### Split\r\n\r\n#### Usage\r\n\r\n`nsplit split [OPTIONS] SRC`\r\n\r\nSplit the file into several chunks by specifying EITHER:\r\n- number of chunks with `--chunk` flag\r\n- size of each chunk with `--size-per-chunk` flag, and the number of chunks is calculated accordingly, i.e. *5kb*, *10mb*, *1gb*\r\n\r\n`SRC` is the filepath.\r\n\r\nOptions:\r\n- `-c, --chunk`, *INTEGER*, number of chunks to output\r\n- `-s, --size`, *TEXT*, size of each chunk\r\n\r\n#### Example\r\n\r\n##### Split a file into 5 chunks\r\n\r\n`nsplit split -c 5 /mnt/c/Users/estep/Videos/Captures/mgs1.mp4`\r\n\r\n```bash\r\n$ nsplit split -c 5 /mnt/c/Users/estep/Videos/Captures/mgs1.mp4\r\n100%|\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588| 5/5 [00:00<00:00, 37.28it/s]\r\nsplitted /mnt/c/Users/estep/Videos/Captures/mgs1.mp4 into 5 chunks\r\n```\r\n\r\n##### Split a file into chunks of 25MB each\r\n\r\n`nsplit split -s 25mb /mnt/c/Users/estep/Videos/Captures/medium.webm`\r\n\r\n```bash\r\n$ nsplit split -s 25mb /mnt/c/Users/estep/Videos/Captures/medium.webm\r\n100%|\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588| 18/18 [00:08<00:00, 2.00it/s]\r\nsplitted /mnt/c/Users/estep/Videos/Captures/medium.webm into 18 chunks\r\n```\r\n\r\n### Merge\r\n\r\n#### Usage\r\n\r\n`nsplit merge [OPTIONS] SRC`\r\n\r\nMerge NFS splitted file chunks into one.\r\n\r\nNFS splitted file chunks can be identified with *.c1*, *.c2* (etc.) appended to the end of original file's name (path).\r\n\r\nIf multiple files that are splitted are found, user can choose which one to merge.\r\n\r\nIf the original file exists under the same directory, a new file with *_copy* appended to the filename will be created.\r\n\r\n`SRC` is the directory path that contains (parent to) splitted file chunks.\r\n\r\nOptions:\r\n- `-r, --remove`, remove splitted file chunks after merge\r\n\r\n#### Example\r\n\r\n##### Merge splitted file chunks into one\r\n\r\n`nsplit merge /mnt/c/Users/estep/Videos/Captures`\r\n\r\n```bash\r\n$ nsplit merge /mnt/c/Users/estep/Videos/Captures\r\n100%|\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588| 5/5 [00:00<00:00, 50.87it/s]\r\nmerged splitted file chunks to /mnt/c/Users/estep/Videos/Captures/mgs1_copy.mp4\r\n```\r\n##### Merge splitted file chunks into one and remove chunks\r\n\r\n`nsplit merge -r /mnt/c/Users/estep/Videos/Captures`\r\n\r\n```bash\r\n$ nsplit merge -r /mnt/c/Users/estep/Videos/Captures\r\n100%|\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588| 5/5 [00:00<00:00, 49.96it/s]\r\nmerged splitted file chunks to /mnt/c/Users/estep/Videos/Captures/mgs1_copy.mp4\r\nremoved splitted file chunks\r\n```\r\n\r\n##### Merge splitted file chunks into one where chunks of other files exist\r\n\r\n`nsplit merge /mnt/c/Users/estep/Videos/Captures`\r\n\r\n```bash\r\n$ nsplit merge /mnt/c/Users/estep/Videos/Captures\r\nfound 2 splitted file chunks, choose one to proceed:\r\n1 - dup.mov\r\n2 - mgs1.mp4\r\nyour answer: 2\r\n100%|\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588| 5/5 [00:00<00:00, 47.95it/s]\r\nmerged splitted file chunks to /mnt/c/Users/estep/Videos/Captures/mgs1_copy.mp4\r\n```\r\n\r\n## Author\r\n\r\n[Binghuan Zhang](https://github.com/estepona) - esteponawondering@gmail.com\r\n\r\n## LICENSE\r\n\r\nMIT\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "a simple CLI tool to split a file into several smaller chunks at data level and merge them back",
"version": "0.3.0",
"project_urls": {
"Homepage": "https://github.com/estepona/naive-file-splitter"
},
"split_keywords": [
"cli",
" file",
" split",
" utility"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "30750f7471997f36193bb79279caa6c26806f1ec7f704e729c559f56d0c78457",
"md5": "ccf3a0885f71a965a1667d825a36fd3e",
"sha256": "876e60dfa95ab18f759eb2a7b8cef6b7a829933062b8055b7365cde13301eeb8"
},
"downloads": -1,
"filename": "nfs_estepona-0.3.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "ccf3a0885f71a965a1667d825a36fd3e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.5",
"size": 6309,
"upload_time": "2024-05-24T00:34:49",
"upload_time_iso_8601": "2024-05-24T00:34:49.491791Z",
"url": "https://files.pythonhosted.org/packages/30/75/0f7471997f36193bb79279caa6c26806f1ec7f704e729c559f56d0c78457/nfs_estepona-0.3.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c7eab0ebf82248ba7de587545d2860b364c0707a0fada104849dd568b153707d",
"md5": "d68c2c9444f00bc7ccb40997edaf277b",
"sha256": "2d1af46850f63e140d1b2e167b37937ea857d48a96dce99917688670b6d99bac"
},
"downloads": -1,
"filename": "nfs_estepona-0.3.0.tar.gz",
"has_sig": false,
"md5_digest": "d68c2c9444f00bc7ccb40997edaf277b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.5",
"size": 5587,
"upload_time": "2024-05-24T00:34:51",
"upload_time_iso_8601": "2024-05-24T00:34:51.069273Z",
"url": "https://files.pythonhosted.org/packages/c7/ea/b0ebf82248ba7de587545d2860b364c0707a0fada104849dd568b153707d/nfs_estepona-0.3.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-05-24 00:34:51",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "estepona",
"github_project": "naive-file-splitter",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "nfs-estepona"
}