nsplit


Namensplit JSON
Version 0.3.1 PyPI version JSON
download
home_pagehttps://github.com/estepona/naive-file-splitter
Summarya simple CLI tool to split a file into several smaller chunks at data level and merge them back
upload_time2024-05-28 21:31:23
maintainerNone
docs_urlNone
authorBinghuan Zhang
requires_python>=3.5
licenseMIT
keywords cli file split utility
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <div align=center>
  <h1>nsplit</h1>
  <img src="https://img.shields.io/badge/nsplit-0.3.*-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>

nsplit (Naive 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.

nsplit works with *any* file format.

## Install

nsplit requires *Python >= 3.5*.

`pip install nsplit`

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": "nsplit",
    "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/4b/24/64618a77f1dd488c8e901908f8a8a33993cd2c189f91c4fc28415dab5dc5/nsplit-0.3.1.tar.gz",
    "platform": null,
    "description": "<div align=center>\r\n  <h1>nsplit</h1>\r\n  <img src=\"https://img.shields.io/badge/nsplit-0.3.*-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\nnsplit (Naive 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\nnsplit works with *any* file format.\r\n\r\n## Install\r\n\r\nnsplit requires *Python >= 3.5*.\r\n\r\n`pip install nsplit`\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.1",
    "project_urls": {
        "Homepage": "https://github.com/estepona/naive-file-splitter"
    },
    "split_keywords": [
        "cli",
        " file",
        " split",
        " utility"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "eef71c4ab7214ed31eccdb5522d50eef25cc8d17ede143e767f0d03f187bd62b",
                "md5": "da0e686ff4c31f98dd4225715846648c",
                "sha256": "6c3938077c0b593abb9479a666fd58738e6ad6499156e5f9debc13e54bb267cf"
            },
            "downloads": -1,
            "filename": "nsplit-0.3.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "da0e686ff4c31f98dd4225715846648c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.5",
            "size": 6207,
            "upload_time": "2024-05-28T21:31:22",
            "upload_time_iso_8601": "2024-05-28T21:31:22.544089Z",
            "url": "https://files.pythonhosted.org/packages/ee/f7/1c4ab7214ed31eccdb5522d50eef25cc8d17ede143e767f0d03f187bd62b/nsplit-0.3.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4b2464618a77f1dd488c8e901908f8a8a33993cd2c189f91c4fc28415dab5dc5",
                "md5": "dbd1220c20450aa07443fd26e69d8998",
                "sha256": "a589b00c92d6f923f92e971142c7580fb71318022203758fd074c97b40658f93"
            },
            "downloads": -1,
            "filename": "nsplit-0.3.1.tar.gz",
            "has_sig": false,
            "md5_digest": "dbd1220c20450aa07443fd26e69d8998",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.5",
            "size": 5587,
            "upload_time": "2024-05-28T21:31:23",
            "upload_time_iso_8601": "2024-05-28T21:31:23.928907Z",
            "url": "https://files.pythonhosted.org/packages/4b/24/64618a77f1dd488c8e901908f8a8a33993cd2c189f91c4fc28415dab5dc5/nsplit-0.3.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-28 21:31:23",
    "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": "nsplit"
}
        
Elapsed time: 3.81116s