sprinkler_util
Project description
Sprinkler Util
Utility functions for use within sprinkler
python tasks.
get_request_body
Use this function to get the request body if it exists.
Optionally convert it to JSON with the as_json
argument.
Will return None
if there is no request body.
from sprinkler_util import get_request_body
body = get_request_body(as_json=True)
if body is None:
raise Exception("NO REQUEST BODY")
...
get_secret
Use this function to get a secret value. Case insensitive.
If the secret is not set, then a SprinklerSecretNotSetException
will be raised.
from sprinkler_util import get_secret
api_key = get_secret("GOOGLE_API_KEY")
...
send_response
This function is used to send a response for a call-and-response
type job.
Only call this function once.
Internally this function wraps what you pass to it in json.dumps
.
from sprinkler_util import send_response
send_response("hello world")
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 Distribution
sprinkler_util-0.1.2.tar.gz
(2.6 kB
view hashes)
Built Distribution
Close
Hashes for sprinkler_util-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ca27322d72f61d29ff19b311404d0caf32052de2fde9a5ea0a97d8b44cdb279 |
|
MD5 | fd32863e80926533c1d70907b945a5ec |
|
BLAKE2b-256 | 90573abf64a00a4af85c6fdadc120b208cb024b4aff493a39d223c71b1a94d49 |