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
Built Distribution
File details
Details for the file sprinkler_util-0.1.3.tar.gz
.
File metadata
- Download URL: sprinkler_util-0.1.3.tar.gz
- Upload date:
- Size: 2.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f88191fc2e4ce4d6ae386cd071b2aa511daacc8b2dae159e0eac08378f09323b |
|
MD5 | cd85fc0c53e3886d16a8fe5922ce89ac |
|
BLAKE2b-256 | d21a676af162d4e96c4d18e5714a3a35225fb3fdb3c2d0f155574bd031e80a77 |
File details
Details for the file sprinkler_util-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: sprinkler_util-0.1.3-py3-none-any.whl
- Upload date:
- Size: 3.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c0febd0e27f896552fc79b3231778f2435ee29c1b80d8dca21ffc778b9a2fec |
|
MD5 | 2cbbee2d547fb62de65da11a2fda9b9f |
|
BLAKE2b-256 | 3e3041caced20069524cca5d0d54d91e82643501aaae17274ac693bf8ca92605 |