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.1.0.tar.gz (6.4 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.1.0-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file strawhat-0.1.0.tar.gz.

File metadata

  • Download URL: strawhat-0.1.0.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.12

File hashes

Hashes for strawhat-0.1.0.tar.gz
Algorithm Hash digest
SHA256 21f0b96825f8326e9771e669cc4e05efb4e3eeef785f120e744677d1a3a6fa69
MD5 179b1ba0fa4d662c7b9fd9589c60c8b6
BLAKE2b-256 7c20ff766a9b9abb61bad89dd0d938beea0bdd7a61f8788a3f04baafea038a72

See more details on using hashes here.

File details

Details for the file strawhat-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: strawhat-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.1 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0e3b5a2541c1067e905b4bb25c0890715c8c061b1c6473a4c7609f029c0bda64
MD5 3430ddde056d475ed5e6e869b24093f5
BLAKE2b-256 cd432397ce8b0dea1449a2dbf6eb7a9c2d4c063f240ef387c6bc9dee915b0f45

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