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

Uploaded Source

Built Distribution

mworks-1.0.3-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mworks-1.0.3.tar.gz
  • Upload date:
  • Size: 3.1 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.3.tar.gz
Algorithm Hash digest
SHA256 451fe3ff92c3f4befab3e1bd818327939502f205227f43045f751344be22ca58
MD5 094bba6402a717e0e294a6e751c9c868
BLAKE2b-256 bbb80e614da0cfccd66f0db6cf95e0c765ad352fb9e03d777bb6690a1385bd56

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mworks-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 4.0 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e9b5b0d275abe9a63d1c1ec701e0780cba7203dda6a12e9a52f2594855310af2
MD5 e0448170428a859326b082ec6bf71483
BLAKE2b-256 dfc12acc1afddc3040f2949cc6069f13682af458c4f5e38f7b82245b6842f80b

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