Skip to main content

Summary

A Cubicweb Storage that stores the data on S3.

It is a standard Cubicweb Storage, similar to the BytesFileSystemStorage. For example, if you want to store File.data payloads in S3, you should create an S3Storage instance, typically in a startup hook, as:

from cubicweb.server.hook import Hook
from cubicweb_s3storage.storages import S3Storage

class S3StorageStartupHook(Hook):
    __regid__ = 'mycube.server-startup-hook'
    events = ('server_startup', 'server_maintenance')

    def __call__(self):
        storage = S3Storage('s3_bucket')
        self.repo.system_source.set_storage('File', 'data', storage)

By default, S3 object keys (ie. S3 object identifiers) are random UUID generated at entity creation time. If you want to implement another key generation algorithm, you must write overload S3Storage.new_s3_key() method.

Communications with AWS are handled by boto3.

Configuration

The S3Storage class constructor needs an S3 bucket name.

If you want to put your aws credentials in an other file than the default (~/.aws/credentials), you must set the AWS_CONFIG_FILE environment variable.

If you want to use another profile name than default, set the AWS_PROFILE environment variable.

If you prefer to configure AWS credentials by environment variables (eg. when using docker), you can use the following variables:

  • AWS_ACCESS_KEY_ID: the access key for your AWS account,

  • AWS_SECRET_ACCESS_KEY: the secret key for your AWS account.

Please read boto3 documentation for more details.

Further configuration

In some cases you might want to use compatible S3 storage which is not on AWS.

For this you have the following variables :

  • AWS_S3_ENDPOINT_URL: endpoint url for your alternative S3 storage

This enables the use of a minio server, see their documentation about endpoints.

Note : this type of variable has been requested upstream (and related aws-cli).

Metadata

Release files for cubicweb-s3storage 4.1.0

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

Source distribution (sdist)

Source distribution for cubicweb-s3storage 4.1.0
File Size Uploaded Provenance Actions
cubicweb_s3storage-4.1.0.tar.gz 12.9 kB Without provenance Details for cubicweb_s3storage-4.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cubicweb-s3storage 4.1.0
File Interpreter ABI Platform Actions
cubicweb_s3storage-4.1.0-py3-none-any.whl Python 3 none any Details for cubicweb_s3storage-4.1.0-py3-none-any.whl

Total release size: 23.5 kB

Release files / cubicweb_s3storage-4.1.0.tar.gz

Download URL cubicweb_s3storage-4.1.0.tar.gz
Size 12.9 kB
Tags Source
SHA-256 checksum
How to use checksums
65bb4ef5e5ba50b19d82263d5700bfcb318644956cc35e23ae17af2a17da74de
BLAKE2b-256 checksum
How to use checksums
078e9a585b313d4d7353ba93c8f89900985091f624f418c0b8767ecc7f41ff7e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release files / cubicweb_s3storage-4.1.0-py3-none-any.whl

Download URL cubicweb_s3storage-4.1.0-py3-none-any.whl
Size 10.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
125d9c48df3459a6f1cc94cd58227a9a47aa5d6fe4b8faf49866463988d7e986
BLAKE2b-256 checksum
How to use checksums
b8de4a4b09e5148d7b69c34982f682a7e3262c6093e5a545ccc06571407674de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Security for cubicweb-s3storage 4.1.0

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