package to save files in s3 in a simple way.
Project description
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 recom_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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file recomb_to_s3-0.1.2.tar.gz.
File metadata
- Download URL: recomb_to_s3-0.1.2.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.2 CPython/3.10.0 Linux/5.15.79.1-microsoft-standard-WSL2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b92368b40e652a22edea42701674ad81350cf5be6c27c6bc0b0ce12cd66d4149
|
|
| MD5 |
5beb5570b4b829ffa8be28f954cef831
|
|
| BLAKE2b-256 |
7e90552acad1aef493e2645ccef2d24a1cec8319e01d5d11f272a7c20bfc6a55
|
File details
Details for the file recomb_to_s3-0.1.2-py3-none-any.whl.
File metadata
- Download URL: recomb_to_s3-0.1.2-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.2 CPython/3.10.0 Linux/5.15.79.1-microsoft-standard-WSL2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c40b03f6e331a2452b1f4044e800075a3001a942758431a05b42f7c0415f3603
|
|
| MD5 |
33c1f439c7f480a1167109c76ceef851
|
|
| BLAKE2b-256 |
d406f239a5ea43516a5d243b196259a482e5f117d174650e222c8898a6381957
|