This repository holds those infrastructure-level modules, that every application requires that follows the core 12-factor principles.
Project description
py-12f-common
About
This repository holds those infrastructure-level modules, that every application requires that follows the core 12-factor principles.
This version of the library is compatible with Python versions >=3.8.
You can use pip to install the library from the Python Package Index:
$ pip install py-12f-common
For further information read the documentation.
Health check
Health check is a web service running on the configured host:port and can be called with HTTP GET request on
/health
endpoint. It is responsible for providing information about the application state.
It complies with the Kubernetes health check guidelines. The response is compiled according to Health Check Response Format for HTTP APIs.
In the configuration, HEALTH_CHECK
(bool) must be included that enables/disables to run health check web service.
HEALTH_CHECK_HOST
(string) and HEALTH_CHECK_PORT
(int) are optional these are the host and port numbers for the web
service (defaults are '127.0.0.1' and 8008).
The initial state is NOINFO
. Call the set_state_warm_up
function just before starting the application, it will set
the state to WARMUP
. Once the application has started working, call the set_state_working
function to set the state
to WORK
. Call set_state_shut_down
just before the application shuts down to set the state to SHUTDOWN
. The
set_state_no_info
function can be used to set the state to NOINFO
if required.
See the examples: minimum
is without health check and asyncq
is with health check.
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 py-12f-common-0.8.0.tar.gz
.
File metadata
- Download URL: py-12f-common-0.8.0.tar.gz
- Upload date:
- Size: 19.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 153dfbebc7a477bdd3aad1b1f301f906e5d2884ac0bdeed4044af121ab465b31 |
|
MD5 | 8a98be9ea00cb062cafe736f6f5cd26a |
|
BLAKE2b-256 | d45cb445a2f0a9ad24227251044b3d8141e6f8d745f3d947340da98fd2490f7f |
File details
Details for the file py_12f_common-0.8.0-py3-none-any.whl
.
File metadata
- Download URL: py_12f_common-0.8.0-py3-none-any.whl
- Upload date:
- Size: 24.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 146f6c8e7a069c7d1d09670bd33ece0c50d8026c10ae6764059627e15ce0db63 |
|
MD5 | af751794ca5018fbb50611d037401aca |
|
BLAKE2b-256 | 4cc400d677c4515622eace2aaa55f32438ad6ff72b34f6a2e13225d88c907d2f |