Skip to main content

splitfile

Python file-like object that facilitates reading and writing of binary data split across multiple volumes (files) of a specified size. Supports random access IO.

Can be used with modules such as tarfile, zipfile, lzma, etc. enabling read/write of split archives.

Note: Version 2.0 removes previously integrated encryption and compression options. The breadth of choice across both suggests they are better handled as a separate layer, leaving splitfile to simply manage the final IO across volumes.

Examples

import splitfile

with splitfile.open('data.bin', 'wb') as f:
    f.write(b'Hello, World!')
import splitfile
import tarfile

with splitfile.open('data.bin', 'wb', volume_size=1000000) as f:
    with tarfile.open(mode='w', fileobj=f) as t:
        for file in files:
            t.add(file)

Result:
data.bin
data.bin.2
data.bin.3
...

Documentation

splitfile.open(filename, mode, volume_size=0, append_to_partial=True)

Returns a SplitFile object.

  • filename contains a valid file path. Volumes add a suffix (.2, .3, etc.).
  • Supported mode values are wb, wb+, ab, ab+, rb, rb+.
  • volume_size specifies the max size of a volume in bytes.
  • append_to_partial set to True appends data written to the end of a previously created file by adding to the last volume if its size is less than volume_size. If False, a new volume is always created for writing beyond the end of an existing file.

Dependencies

None

Installation

pip install splitfile

Metadata

Release files for splitfile 2.0.2

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

Source distribution (sdist)

Source distribution for splitfile 2.0.2
File Size Uploaded Provenance Actions
splitfile-2.0.2.tar.gz 6.4 kB Without provenance Details for splitfile-2.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for splitfile 2.0.2
File Interpreter ABI Platform Actions
splitfile-2.0.2-py3-none-any.whl Python 3 none any Details for splitfile-2.0.2-py3-none-any.whl

Total release size: 24.7 kB

Release files / splitfile-2.0.2.tar.gz

Download URL splitfile-2.0.2.tar.gz
Size 6.4 kB
Tags Source
SHA-256 checksum
How to use checksums
d36a9f42920201aed7448c79af4fe6fc5233dd928e91bc146c8663530b1c5fec
BLAKE2b-256 checksum
How to use checksums
b3dfc6826152fc532901708a8ec4719c66d36066ee36423799f616bfd96663fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.39.0 CPython/3.8.0

Release files / splitfile-2.0.2-py3-none-any.whl

Download URL splitfile-2.0.2-py3-none-any.whl
Size 18.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7d378f0e9265cd3e208fb9706da0265bec7db78374c892d0e007317c3cc30de3
BLAKE2b-256 checksum
How to use checksums
e990e0a624ceeda71f86f30f5e60759f42d8800e2bfe4cd5bf5872efe7e8e60c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.39.0 CPython/3.8.0

Security for splitfile 2.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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