Skip to main content

A common utility framework for web microservices

Project description

mworks

The goal of this project is to remove some boilerplate and add few standard routes to flask applications.

Usage

Add common routes to the flask application:

from mworks import CommonRoutes
from flask import Flask

app = Flask(__name__)
mworks = CommonRoutes(app)

You can optionally add authorisation for sensitive endpoints:

is_admin = lambda: request.remote_addr == '127.0.0.1'
mworks = CommonRoutes(app, auth_checks=[is_admin])

Features

CommonRoutes has the following endpoints implemented:

  • /healthz - Always returns HTTP 200, useful for healthchecks
  • /varz - Get variables for service monitoring. Customizable.
  • /docz - Read README.md from the application and render it.
  • /logz - Render logs from the application in the browser.

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

mworks-1.0.4.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

mworks-1.0.4-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file mworks-1.0.4.tar.gz.

File metadata

  • Download URL: mworks-1.0.4.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.8

File hashes

Hashes for mworks-1.0.4.tar.gz
Algorithm Hash digest
SHA256 87521f467415169c72539b476215c4f4369ec89b2e33ccc55ca0e5050a35d33d
MD5 81183653793df22110e7c45e909076f8
BLAKE2b-256 69a706201c36fae6e6012fee3ff41f619b4fc596926b29828473b797325a0844

See more details on using hashes here.

File details

Details for the file mworks-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: mworks-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.8

File hashes

Hashes for mworks-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 b5c75ea21608d623f5a7e648190f11871f22281ed64eff1df0dcaf3f601c15e4
MD5 e3042854f51aa5f3ce1ba6c6f7494b07
BLAKE2b-256 4e27b6ea3c680956cb6e36026236bc7e81cad86ae1ce71879822a1f5f162d9b9

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