Skip to main content

Simple AWS API for S3, DynamoDB, SNS, and SQS

Project description

AWSimple

(pronounced A-W-Simple)

Simple API for basic AWS services such as S3 (Simple Storage Service), DynamoDB (a NoSQL database), SNS (Simple Notification Service), and SQS (Simple Queuing Service).

Project featured on PythonBytes Podcast Episode #224.

Full documentation available on Read the Docs .

Features:

  • Simple Object Oriented API on top of boto3

  • One-line S3 file write, read, and delete

  • Automatic S3 retries

  • Locally cached S3 accesses

  • True file hashing (SHA512) for S3 files (S3's etag is not a true file hash)

  • DynamoDB full table scans (with local cache option)

  • DynamoDB secondary indexes

  • Built-in pagination (e.g. for DynamoDB table scans and queries). Always get everything you asked for.

  • Can automatically set SQS timeouts based on runtime data (can also be user-specified)

Usage

pip install awsimple

Examples

The example folder has several examples you can customize and run. Instructions are available in examples

S3

# print string contents of an existing S3 object
s = S3Access(profile_name="testawsimple", bucket="testawsimple").read_string("helloworld.txt")
print(s)

DynamoDB

dynamodb_access = DynamoDBAccess(profile_name="testawsimple", table_name="testawsimple")

# put an item into DynamoDB
dynamodb_access.put_item({"id": "batman", "city": "Gotham"})

# now get it back
item = dynamodb_access.get_item("id", "batman")
print(item["city"])  # Gotham

Introduction

awsimple is a simple interface into basic AWS services such as S3 (Simple Storage Service) and DynamoDB (a simple NoSQL database). It has a set of higher level default settings and behavior that should cover many basic usage models.

Discussion

AWS's "serverless" resources offer many benefits. You only pay for what you use, easily scale, and generally have high performance and availability.

While AWS has many varied services with extensive flexibility, using it for more straight-forward applications is sometimes a daunting task. There are access modes that are probably not requried and some default behaviors are not best for common usages. awsimple aims to create a higher level API to AWS services (such as S3, DynamoDB, SNS, and SQS) to improve programmer productivity.

S3

awsimple calculates the local file hash (sha512) and inserts it into the S3 object metadata. This is used to test for file equivalency.

Caching

S3 objects and DynamoDB tables can be cached locally to reduce network traffic, minimize AWS costs, and potentially offer a speedup.

Whatawsimple Is Not

  • awsimple is not necessarily the most memory and CPU efficient

  • awsimple does not provide cost monitoring hooks

  • awsimple does not provide all the options and features that the regular AWS API (e.g. boto3) does

Contributing

Contributions are welcome, and more information is available in the contributing guide.

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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

awsimple-0.15.0-py3-none-any.whl (25.3 kB view details)

Uploaded Python 3

File details

Details for the file awsimple-0.15.0-py3-none-any.whl.

File metadata

  • Download URL: awsimple-0.15.0-py3-none-any.whl
  • Upload date:
  • Size: 25.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.1.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.9.1

File hashes

Hashes for awsimple-0.15.0-py3-none-any.whl
Algorithm Hash digest
SHA256 439ae2c661ad9c463bb0914fdd870ab3b1458aca497c0b9839729a65f4d025fe
MD5 86ec61ee8b0eb03e24da68f21e10e35a
BLAKE2b-256 54be5b877c45c2652c72de5c800a3b6a6dc315a3b105877d0069d04930963b47

See more details on using hashes here.

Supported by

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