Skip to main content

Recomb to S3

Installation

Installing from PyPI is as easy as doing:

  pip install recomb-to-s3

create the following environment variables in your settings:

    AWS_ACCESS_KEY_ID="__your_secret_id__"
    AWS_SECRET_ACCESS_KEY="__your_secret_key__"
    AWS_STORAGE_BUCKET_NAME="__your_bucket_name__"
    AWS_S3_SIGNATURE_VERSION="s3v4"
    AWS_S3_REGION_NAME="__your_region_name__"
    AWS_S3_FILE_OVERWRITE=False # true if you want to write over the file in s3
    AWS_DEFAULT_ACL = "public-read" # to have access by the django admin
    DEFAULT_FILE_STORAGE="storages.backends.s3boto3.S3Boto3Storage"

add recomb_to_s3 and storages in your installed apps

INSTALLED_APPS = [
    "storages",
    "recomb_to_s3",
]

run the migration

python manage.py migrate

About

The library aims to facilitate the sending of python dictionaries to an amazon s3 backet, however it is possible to send any type of file, or you can import the AbstractRecombToS3 class and add or remove fields according to your needs.

How To Use

the most basic way to use this package is very simple, just import the "send_dict_to_s3" function and use it as in the example below.

from recomb_to_s3.contrib import send_dict_to_s3

data = {"test": "test"}

my_model = send_dict_to_s3(data=data, file_name="my_file.json", author=None)

Dependencies

[tool.dependencies]
python = "^3.10"
boto3 = "^1.26.47"
django-storages = "^1.13.2"
django = "^4.1"

Contributing


Alexandre Jastrow da Cruz

Metadata

Release files for recomb-to-s3 0.1.3

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

Source distribution (sdist)

Source distribution for recomb-to-s3 0.1.3
File Size Uploaded
recomb_to_s3-0.1.3.tar.gz 4.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for recomb-to-s3 0.1.3
File Interpreter ABI Platform
recomb_to_s3-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 10.2 kB

Release files / recomb_to_s3-0.1.3.tar.gz

Download URL recomb_to_s3-0.1.3.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
7d68169d2520456dcd581bc2c466100715802053d7f71cb5ab27446f3c4e700b
BLAKE2b-256 checksum
How to use checksums
247af10ce950f1a585161631dd23ed2e2a5c24782d1278908a0e35aaad82ceeb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.2.2 CPython/3.10.0 Linux/5.15.79.1-microsoft-standard-WSL2

Release files / recomb_to_s3-0.1.3-py3-none-any.whl

Download URL recomb_to_s3-0.1.3-py3-none-any.whl
Size 5.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d287679e56539ae60a4fbfd8030dc763054735b3798568e40b5b6a33a8085657
BLAKE2b-256 checksum
How to use checksums
cfd83fc5f9cf425d56fdb2af98d72129d1fb84aefda9a61c5e33c4f0f495f82c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.2.2 CPython/3.10.0 Linux/5.15.79.1-microsoft-standard-WSL2

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.2

2 release files

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