this is the Halo framework library for Flask
Project description
Halo
The Halo Lib is a python based library utilizing Serverless technology and microservices architecture
Halo provides the following features:
- Flask development for AWS Lambda & Dynamodb
- correlation id across microservices
- structured json based logging
- sample debug log in production
- support for microservice transactions with the saga pattern
- using SSM Parameter Store over Lambda env variables
- Serverless Error Handling & trace id for end users
- Lambda timeout management for slow HTTP responses
- ootb support for Idempotent service invocations (md5)
If you are building a Python web app running on AWS Lambda (Django or Flask), use this library to manage api transactions:
sagax = load_saga("test", jsonx, schema)
payloads = {"BookHotel": {"abc": "def"}, "BookFlight": {"abc": "def"}, "BookRental": {"abc": "def"},
"CancelHotel": {"abc": "def"}, "CancelFlight": {"abc": "def"}, "CancelRental": {"abc": "def"}}
apis = {"BookHotel": self.create_api1, "BookFlight": self.create_api2, "BookRental": self.create_api3,
"CancelHotel": self.create_api4, "CancelFlight": self.create_api5, "CancelRental": self.create_api6}
try:
self.context = Util.get_lambda_context(request)
ret = sagax.execute(self.req_context, payloads, apis)
return {"saga": "good"}, 200
except SagaRollBack as e:
return {"saga": "bad"}, 500
License
This project is licensed under the MIT License
Acknowledgments
- Yan Cui - https://theburningmonk.com
- flowpl - https://github.com/flowpl/saga_py
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
halo_flask-0.15.101.tar.gz
(38.8 kB
view details)
File details
Details for the file halo_flask-0.15.101.tar.gz
.
File metadata
- Download URL: halo_flask-0.15.101.tar.gz
- Upload date:
- Size: 38.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.20.1 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a65e5d347f8acb5e422404e2a702cbcc9fec588b518a8498fe37762d968b1798 |
|
MD5 | f952a1236a4cd26fb92f066a772a5718 |
|
BLAKE2b-256 | 8435026aee3ee086b152787f8d182a1f79094cc1ff6a147ab125f30fe8bb8190 |