Skip to main content

A library for dealing with splittable files

Project description

# Splits

Splits is a library for reading and writing files in splittable chunks.
It works on any file-like object.
There is built in support for writing and reading split files from S3.
It also has built in support for gzip.

## Installation

```
$ pip install splits
```

## Usage

```python
from splits import SplitWriter, SplitReader
from splits.s3 import S3File, GzipS3File

if __name__ == '__main__':

with SplitWriter('s3://test-bucket/test-multifile',
suffix='.txt', lines_per_file=100,
fileClass=GzipS3File) as w:
w.writelines([str(x) for x in range(0, 1000)])

with SplitReader('s3://test-bucket/test-multifile',
fileClass=GzipS3File) as r:
for line in r:
print line

```

## Tests

```
$ pip install tox
```

To run the tests in both Python2 and Python3 run,

```
$ tox
```

Project details


Download files

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

Source Distribution

splits-0.1.9.tar.gz (5.5 kB view details)

Uploaded Source

File details

Details for the file splits-0.1.9.tar.gz.

File metadata

  • Download URL: splits-0.1.9.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for splits-0.1.9.tar.gz
Algorithm Hash digest
SHA256 0d599bdf25482d0a9cb8a5b095542fe3cdf2c4bc8bd13e8ef3cb2b83f7e36678
MD5 6e551ff35e15fcead855e54eee40df45
BLAKE2b-256 5d81bc07f052628e2a035ab2b3dae55bb9cb15cf0d9cfde83936cbd504a1e977

See more details on using hashes here.

Supported by

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