Skip to main content

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 LastEvaluatedKey while calling scan and query operations
  • Module will convert float to Decimal while calling put and update operations
  • Module will convert Decimal to float while 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


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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

strawhat-0.2.0-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

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

Hashes for strawhat-0.2.0.tar.gz
Algorithm Hash digest
SHA256 466d33c18e2161dd3126c138555d6f76146a8574c83c6630f4205369167e3c73
MD5 aae6edf359703c0fd39d88157dbe0e3b
BLAKE2b-256 220fe8a7e1c5c3cad6bdc0575551db9a1564ec004d21ddbe69b2257fcf260835

See more details on using hashes here.

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

Hashes for strawhat-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 419ecdbeb060972c2e97e751ee40d5730554c114ec348e84c79804bb20c415e2
MD5 9ee9be6cf5001abee82cbf3083e5ab6f
BLAKE2b-256 a993899c7bb584780b29628d3bda3746f55e8ea2e5a9525b71deccb764e94092

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page