Skip to main content

Jar make it easy to store the state of your AWS Lambda functions.

Project description

Jar makes it easy to save the state of your AWS Lambda functions. The data (either a dict or list) can be saved within the Lambda itself as an environment variable or on S3.

Install

pip install awsjar

Examples

Save state with Jar inside a Lambda environment variable

import awsjar

# Save your data with the Lambda itself, as an Environment Variable.
jar = awsjar.Jar(lambda_name='sams-lambda')
data = {'num_acorns': 50, 'acorn_hideouts': ['tree', 'lake', 'backyard']}
jar.put(data)

state = jar.get()
>> {'num_acorns': 50, 'acorn_hideouts': ['tree', 'lake', 'backyard']}

Save state with Bucket on an S3 bucket

import awsjar

# Save your data to an S3 object - s3://my-bucket/state.json
bkt = awsjar.Bucket(bucket='my-bucket', key='state.json')

data = {'num_acorns': 50, 'acorn_hideouts': ['tree', 'lake', 'backyard']}
bkt.put(data)

state = bkt.get()
>> {'num_acorns': 50, 'acorn_hideouts': ['tree', 'lake', 'backyard']}

Docs

User Guide

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

awsjar-0.2.7.tar.gz (22.1 kB view details)

Uploaded Source

File details

Details for the file awsjar-0.2.7.tar.gz.

File metadata

  • Download URL: awsjar-0.2.7.tar.gz
  • Upload date:
  • Size: 22.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0

File hashes

Hashes for awsjar-0.2.7.tar.gz
Algorithm Hash digest
SHA256 db37e915e96e4b231aa867c6b95dcaba4d0e4b5e9dedfe127b29d052efe87a79
MD5 daa3dd34f3360d8c0ce85fec88fb8495
BLAKE2b-256 aa3f740c1c0b00313c8a396a8365c9077a3c3edf7932ac4e7e1f277f7792f1be

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