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.5.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: mworks-1.0.5.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.5.tar.gz
Algorithm Hash digest
SHA256 5284666e6b88b9af4b2e8a57d6241f8964b4ec57cb193a6285647f073cdfd4f8
MD5 f116cc3e36dd277a151923091da2c87c
BLAKE2b-256 ff1c641988a18647aa58106b1514217401e375e8fa8d4467876293b36b26d7ed

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mworks-1.0.5-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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 8bf99100ace05346b198951c234feb9da3739a386cf0f62c46c48788242396c0
MD5 e135c707b0dca7e84ce75098b6680955
BLAKE2b-256 0c07993eacc0aee8f83129fe69ef9506d2a682c92aa964c097bd8b5d013c8389

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