Skip to main content

Python S3 Upload Split

S3 Upload Split is used to stream the content of an iterator to multiple S3 objects based on a provided regular expression. The iterator must be a list of dictionary, typically the resulset of a SQL query. Files will be called data-{pattern}.json where {pattern} is the match found using your regex.

Install

pip install s3-upload-split

Usage

Import

import re
from sqlalchemy import create_engine
from s3_upload_split import SplitUploadS3

bucket = 'YOUR_BUCKET_NAME' # ex: my-bucket
prefix = 'OUTPUT_PATH' # ex: db1/output/dev/
regex = re.compile(r'YOUR_REGEX') # ex: \\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}\\D+(\\d{4}-\\d{2})-\\d{2}
engine = create_engine('sqlite:///bookstore.db') # https://github.com/pranaymethuku/bookstore-database/blob/master/database/bookstore.db

with engine.connect() as con:

    iterator = con.execute('SELECT * FROM book')
    SplitUploadS3(bucket, prefix, regex, iterator).handle_content()

Limitations

It creates one thread per matched pattern using your regex, so take it into account when you use that module. This is typically useful if your regex matches months in the input iterator.

Metadata

Release files for s3-upload-split 0.1.6

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

Source distribution (sdist)

Source distribution for s3-upload-split 0.1.6
File Size Uploaded Provenance Actions
s3-upload-split-0.1.6.tar.gz 3.7 kB Without provenance Details for s3-upload-split-0.1.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for s3-upload-split 0.1.6
File Interpreter ABI Platform Actions
s3_upload_split-0.1.6-py3-none-any.whl Python 3 none any Details for s3_upload_split-0.1.6-py3-none-any.whl

Total release size: 7.3 kB

Release files / s3-upload-split-0.1.6.tar.gz

Download URL s3-upload-split-0.1.6.tar.gz
Size 3.7 kB
Tags Source
SHA-256 checksum
How to use checksums
ece68ef800b578d67fb631e70df9ee2fd6cdf096a8e4c722ab05d87ce1377492
BLAKE2b-256 checksum
How to use checksums
7f444c67936c7555a6f3620a69f43bd00fc4f81ef642b7b86361e9ef12a126d6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.11 CPython/3.8.11 Darwin/20.6.0

Release files / s3_upload_split-0.1.6-py3-none-any.whl

Download URL s3_upload_split-0.1.6-py3-none-any.whl
Size 3.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
18999691b236f8f9d4765a078a4cf4fdad9bd64cc7855ae27f2dc85bae1e8737
BLAKE2b-256 checksum
How to use checksums
b41241445e229eddd27513839d3dc6c8aecfb6d7fedf79952cd08068535cdb05
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.11 CPython/3.8.11 Darwin/20.6.0

Security for s3-upload-split 0.1.6

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.

Release history Release notifications | RSS feed

This release

0.1.6 This release

2 release files No provenance

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