Skip to main content

Library of utils to create REST Python Microservices

Project description

Python Microservices Library

PyPI version Build Status Coverage Status Requirements Status Total alerts Language grade: Python

PyMS, Python MicroService, is a collections of libraries, best practices and recommended ways to build microservices with Python.

Documentation

To know how use, install or build a project see the docs: https://py-ms.readthedocs.io/en/latest/

Motivation

When we started to create microservice with no idea, we were looking for tutorials, guides, best practices, but we found nothing to create professional projects. Most articles say:

  • "Install flask"
  • "Create routes"
  • (Sometimes) "Create a swagger specs"
  • "TA-DA! you have a microservice"

But... what happens with our configuration out of code like Kubernetes configmap? what happens with transactionality? If we have many microservices, what happens with traces?.

There are many problems around Python and microservices and we can`t find anyone to give a solution.

We start creating these projects to try to solve all the problems we have found in our professional lives about microservices architecture.

Nowadays, is not perfect and we have a looong roadmap, but we hope this library could help other felas and friends ;)

Installation

pip install py-ms

Structure

pyms/config

Module to read yaml or json configuration from a dictionary or a path.

pyms/flask/app

With the function create_app initialize the Flask app, register blueprints and initialize all libraries such as Swagger, database, trace system, custom logger format, etc.

pyms/flask/services

Integrations and wrappers over common libs like request, swagger, connexion

pyms/flask/healthcheck

This view is usually used by Kubernetes, Eureka and other systems to check if our application is running.

pyms/logger

Print logger in JSON format to send to server like Elasticsearch. Inject span traces in logger.

pyms/tracer

Create an injector flask_opentracing.FlaskTracer to use in our projects.

How To Contrib

We appreciate opening issues and pull requests to make PyMS even more stable & useful! See This doc for more details

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-ms-1.2.0.tar.gz (28.5 kB view hashes)

Uploaded Source

Built Distribution

py_ms-1.2.0-py3-none-any.whl (71.8 kB view hashes)

Uploaded Python 3

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