Wrapper module for aws boto3
Project description
pypi-strawhat
My own python module with useful functions
strawhat module contains wrapper for aws boto3
This module makes interacting with aws services quite simple. It is built on top of AWS' boto3 module
Key Features
- Module has in built handling of
LastEvaluatedKeywhile calling scan and query operations- Module will convert
floattoDecimalwhile calling put and update operations- Module will convert
Decimaltofloatwhile calling scan and query operations
How to use
Below snippet contains a basic guide to use access dynamodb
# imports
from strawhat.aws import AWS, Dynamodb
# constants
access_key = '***'
secret_key = '***'
region = 'ap-south-1'
table_name = 'my_table'
# initialising aws instance
aws = AWS(access_key, secret_key, region) # default region is 'ap-south-1'
db_resource = aws.resource('dynamodb')
# initialise dynamodb
ddb = Dynamodb(db_resource)
ddb.connect2table(table_name)
# executing a scan operation
conditions = {} # put the conditions for scan in the dictionary
responses = ddb.scan_table(table_name, conditions)
Supported Functions
Dynamodb
- scan_table(table_name, conditions)
- query_table(table_name, conditions)
- put_data(table_name, data)
- get_data(table_name, conditions)
- update_row(table_name, conditions)
- delete_row(table_name, conditions)
- batch_write(table_name, data_list)
S3
- read_object(bucket_name, bucket_object)
- put_object(bucket_name, bucket_object, content)
User Note
The module is still a work in progress
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
strawhat-0.2.0.tar.gz
(7.3 kB
view details)
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 strawhat-0.2.0.tar.gz.
File metadata
- Download URL: strawhat-0.2.0.tar.gz
- Upload date:
- Size: 7.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
466d33c18e2161dd3126c138555d6f76146a8574c83c6630f4205369167e3c73
|
|
| MD5 |
aae6edf359703c0fd39d88157dbe0e3b
|
|
| BLAKE2b-256 |
220fe8a7e1c5c3cad6bdc0575551db9a1564ec004d21ddbe69b2257fcf260835
|
File details
Details for the file strawhat-0.2.0-py3-none-any.whl.
File metadata
- Download URL: strawhat-0.2.0-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
419ecdbeb060972c2e97e751ee40d5730554c114ec348e84c79804bb20c415e2
|
|
| MD5 |
9ee9be6cf5001abee82cbf3083e5ab6f
|
|
| BLAKE2b-256 |
a993899c7bb584780b29628d3bda3746f55e8ea2e5a9525b71deccb764e94092
|