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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: mworks-1.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 14059889dd7a1d401dd69e929fbc1a0a5486d2e86f57da91dec95fa40f66766a
MD5 ca24e81cdd04554dea55e124795031df
BLAKE2b-256 733860ccb18017e97d8df7176e5aa36c2d5e8f3fd1f6fc408d094a1b5f6a752f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mworks-1.0.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3ef088056c43a22c642eb7c8ad6db763b66212f60a333c097aca589369280ed4
MD5 feee96e85a6a0adc5788a575f10ca040
BLAKE2b-256 f1e222852d7a5ea84b0ee2c0e40691bd82fa6a1ba78a209e89d9fd0d599ef181

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