Skip to main content

DRB aws3 driver

Project description

Amazon simple storage service driver

This drb-driver-s3 module implements S3 protocol access with DRB data model.

S3 Factory and S3 Node

The module implements the factory model defined in DRB in its node resolver. Based on the python entry point mechanism, this module can be dynamically imported into applications.

The entry point group reference is drb.drivers.aws3.
The driver name is aws3.
The factory class is encoded into drb.drivers.aws3.
The S3 signature id is 4ab73f92-bbff-11ec-8422-0242ac120002.

Using this module

The project is present in https://www.pypi.org service. it can be freely loaded into projects with the following command line:

pip install drb-driver-s3

Access Data

DrbS3Node manages the s3 protocol to access remote data. The construction parameter is an authentication object.

from drb.drivers.aws3 import DrbS3Service, Auth
from botocore.config import Config

auth = Auth(service_name='s3',
            endpoint_url='http://your_s3_storage/',
            aws_access_key_id='user',
            aws_secret_access_key='password',
            config=Config(signature_version='s3v4'),
            region_name='us-east-1')
node = DrbS3Service(auth)

When accessing a DrbS3Service the node gives access to all the bucket of this service by giving a list of DrbS3Bucket, and then each node gives a list of DrbS3Object for each object in the bucket.

Resolving an s3:// URL

An s3://bucket/key URL resolves to:

  • a DrbS3Service for s3:// (no bucket),
  • a DrbS3Bucket for s3://bucket or any key ending with / (a prefix),
  • a DrbS3Object for a key that is a real object.

When the key is not a real object, the factory raises DrbFactoryException (it probes existence with a HeadObject). This lets the DRB resolver walk the path segment by segment and descend an intermediate container instead of building a bogus object node whose first read would 404. It is what makes a key that continues inside an archive resolvable, e.g.:

from drb.topics.resolver import create
# descend into a zipped product on S3 and force the XML driver on a leaf
# that has no .xml extension:
node = create('s3+xml://bucket/product.zip/product.SAFE/manifest.safe')

The existence HeadObject is cached in the node context (node.context['resolver']['head']) so opening the object stream does not issue a second HeadObject.

Limitations

This driver doesn't allow to write, modify, delete file on a s3 bucket, or it doesn't allow to delete or upload a file. This driver doesn't allow to download directly a bucket.

Documentation

The documentation of this implementation can be found here https://drb-python.gitlab.io/impl/aws3

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

drb_driver_s3-1.3.9.tar.gz (37.3 kB view details)

Uploaded Source

File details

Details for the file drb_driver_s3-1.3.9.tar.gz.

File metadata

  • Download URL: drb_driver_s3-1.3.9.tar.gz
  • Upload date:
  • Size: 37.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/9.0.0 pkginfo/1.12.1.2 requests/2.34.2 requests-toolbelt/1.0.0 tqdm/4.68.3 CPython/3.11.15

File hashes

Hashes for drb_driver_s3-1.3.9.tar.gz
Algorithm Hash digest
SHA256 1d74401025dbdda053a38d5475f8e76528a2a3a933f102b0c5525ddbf9b533a7
MD5 0a66ccd45a6b10ea5c1ffd6eeb428cb8
BLAKE2b-256 699efd1d1e4accaf6d1bb4dfccc8388c9b89829526135771e9449dc8abef7e05

See more details on using hashes here.

Supported by

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