boto3_large_message_utils
This library provides a way of bypassing AWS size restrictions when using services such as SQS and SNS, by providing methods to cache message bodies in S3 and parse them again at the other end.
Usage
Install
Install the package using pip
pip install boto3_large_message_utils
Initialise Handler
Import and set up the LargeMessageBuilder
from boto3_large_message_utils import LargeMessageBuilder
builder = LargeMessageBuilder(
s3_bucket_for_cache='my-bucket', #REQUIRED
s3_object_prefix='my-prefix',
compress=True,
#message_size_threshold=100000, # Pass an optional message size threshold
#session=session, # Pass an optional boto3 session to initialise the client from the session
)
Handle a message
# create your message in the normal way, build expects a string
msg = json.dumps({ 'content': 'this is my message' })
# submit your message to the handler
new_msg = builder.build(msg)
# send message to SQS, SNS or another AWS service
Message with Message Attributes
# create your message in the normal way, build expects a string
msg = json.dumps({ 'content': 'this is my message' })
msg_attr = {
"MSG_ATTR": {
"StringValue": "my-value"
}
}
# submit your message to the handler
msg = builder.build(msg, msg_attr)
# send message to SQS, SNS or another AWS service
Parse a message
Handle a message that has been optimised by the Base.
# received message from SQS or another AWS service.
parser = LargeMessageParser(
#session=session, # Pass an optional boto3 session to initialise the client from the session
)
msg = parser.parse(received_message)
Metadata
Release files for boto3-large-message-utils 0.2.0
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 | |
|---|---|---|---|---|
| boto3_large_message_utils-0.2.0.tar.gz | 5.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| boto3_large_message_utils-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.7 kB
Release files / boto3_large_message_utils-0.2.0.tar.gz
| Download URL | boto3_large_message_utils-0.2.0.tar.gz |
|---|---|
| Size | 5.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9078566668cae8e4af49e3bf9ccd60be0524a2b48f2a03aec200083765f2d2f1
|
|
BLAKE2b-256 checksum How to use checksums |
2fe9611efbaa0d9cc25e8e5d224104843c5957531a0068dde072d7285becbf97
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6
|
Release files / boto3_large_message_utils-0.2.0-py3-none-any.whl
| Download URL | boto3_large_message_utils-0.2.0-py3-none-any.whl |
|---|---|
| Size | 8.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7dd652344927970988a9320abea7c7e942aa72f759d4ab3899a6571f328fe1b5
|
|
BLAKE2b-256 checksum How to use checksums |
825eaff965f8dd6cb78e77c1525f5f9e7302ae2aa6273fcb794f63dbe073ca27
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6
|
Security for boto3-large-message-utils 0.2.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.