Skip to main content

Handy dandy functions for python development using the Serverless framework

Project description

## serverless_helpers

This library isn't *required* for writing Python in the [serverless][sls], but
it does make your life easier by handling things like environment variables for
you.

## Usage

```
import serverless_helpers

# all .env files are loaded into the environment
serverless_helpers.load_envs(__file__)

# Loads stack outputs into environment variables as `SERVERLESS_CF_[output name]`
serverless_helpers.load_cfn_outputs()

import os
os.getenv('SERVERLESS_STAGE') # dev

# get role ARN from default serverless CloudFormation stack
os.getenv('SERVERLESS_CF_IamRoleArnLambda') # arn:aws:iam::123456789012:....

# alternate way to read roles
outputs = serverless_helpers.load_cfn_outputs()
outputs['IamRoleArnLambda'] # arn:aws:iam::123456789012:....
```

## License

This code is released under the MIT software license, see LICENSE file for
details. No warranty of any kind is included, and the copyright notice must be
included in redistributions.

*Notable exception*: `dotenv.py` is from
[python-dotenv](https://github.com/theskumar/python-dotenv) to remove
dependencies on click and ordereddict for performance/deployment size reasons.
Read the license contained in `dotenv.py` for details on its creators and
license conditions.

[sls]: http://serverless.com/

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

serverless_helpers-0.3.0.tar.gz (2.3 kB view details)

Uploaded Source

Built Distribution

serverless_helpers-0.3.0-py2-none-any.whl (3.6 kB view details)

Uploaded Python 2

File details

Details for the file serverless_helpers-0.3.0.tar.gz.

File metadata

File hashes

Hashes for serverless_helpers-0.3.0.tar.gz
Algorithm Hash digest
SHA256 59109d56669ed2d977ce4d8f97400f3535923165f89a1b2127a19b39852e4bf1
MD5 9194e3cdd33abfa5ccf32653877825a4
BLAKE2b-256 62d61bc1d894b94c99de57744d8eb452de4bc45567ca05791b6c2ca41eb9a0c4

See more details on using hashes here.

File details

Details for the file serverless_helpers-0.3.0-py2-none-any.whl.

File metadata

File hashes

Hashes for serverless_helpers-0.3.0-py2-none-any.whl
Algorithm Hash digest
SHA256 0e8a0ab1ee1163b05f5af7baf70b8fcc69f0ffda3891bb90edbc9bcbaacecd30
MD5 0c55421a167f7ddb712b26b607f1d749
BLAKE2b-256 891b321a7a8d8af4d3b8601d79fc2a133ad12dd2312e7e6606b1a80237ea5c71

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