Skip to main content

This repository holds those infrastructure-level modules, that every application requires that follows the core 12-factor principles.

Project description

py-12f-common

Quality Check Status Coverage

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py-12f-common-0.7.1.tar.gz (19.4 kB view details)

Uploaded Source

Built Distribution

py_12f_common-0.7.1-py3-none-any.whl (24.2 kB view details)

Uploaded Python 3

File details

Details for the file py-12f-common-0.7.1.tar.gz.

File metadata

  • Download URL: py-12f-common-0.7.1.tar.gz
  • Upload date:
  • Size: 19.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for py-12f-common-0.7.1.tar.gz
Algorithm Hash digest
SHA256 81463f6242352a1754f5eb6f9c78391574dadc00c6f31cf92cfdbc4b5cfe88e3
MD5 88eba2e5023d69251bdcbd1705c1ea34
BLAKE2b-256 6af2b8f91442f0c03fe657a4a344a4e1c7b29fd6e4b37adbc31c222973c1db84

See more details on using hashes here.

File details

Details for the file py_12f_common-0.7.1-py3-none-any.whl.

File metadata

File hashes

Hashes for py_12f_common-0.7.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b9619b50d48c2c6d999a8bcc66b2dc1012a8598198e0a9b76b17da73d566f377
MD5 a2330e3a64e8a872be19c480f3c0f4e0
BLAKE2b-256 09fc69191949b8820269ee2a759d68dc911d8661086ea659ef9ffeda2f2da75f

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