About
s3io is a minimalistic python module which provides file object access to data on S3.
All data manipulations are done via temporary local files - so you will actually work with local temp file which is a file object with all its methods supported.
Just keep in mind these facts:
Reading: the whole file will be downloaded to local temporary location at entering the context.
Writing: temp file will be provided at entering the context. Actual saving to S3 will be performed at exit from context. Thus such methods as flush will not influence the process of saving to S3.
Dependencies
Examples
s3io is intended to be used via context manager only.
There are three ways to provide access to s3:
Directly providing s3_connection.
Providing credentials: aws_access_key_id and aws_secret_access_key.
Providing profile_name. This method is recommended to use. See boto docs for more info.
Reading file using existing S3 connection:
import s3io
s3 = boto.connect_s3()
with s3io.open('s3://<bucket>/<key>', s3_connection=s3) as s3_file:
contents = s3_file.read()
Reading file using credentials:
credentials = dict(
aws_access_key_id='<ACCESS_KEY>',
aws_secret_access_key='<SECRET_KEY>',
)
with s3io.open('s3://<bucket>/<key>', **credentials) as s3_file:
contents = s3_file.read()
Reading file using profile:
with s3io.open('s3://<bucket>/<key>', profile_name='<profile>') as s3_file:
contents = s3_file.read()
Writing file using profile:
with s3io.open('s3://<bucket>/<key>', mode='w', profile_name='<profile>') as s3_file:
s3_file.write('Some data.')
Exceptions
Possible exceptions:
s3io.BucketNotFoundError
s3io.KeyNotFoundError
s3io.UrlParseError
Metadata
Release files for s3io 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| s3io-0.1.1.tar.gz | 3.0 kB | Without provenance | Details |
Release files / s3io-0.1.1.tar.gz
| Download URL | s3io-0.1.1.tar.gz |
|---|---|
| Size | 3.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b80687a7f448855fe76e2089d39df293bf810a4274882688e36237a22d148c71
|
|
BLAKE2b-256 checksum How to use checksums |
534d1787b26b76c5a01525e07626a64b3a77b8c77cd275e8cfd56e0d9ae97dd5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for s3io 0.1.1
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.