Skip to main content

Python Microservices Library

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

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

To know how use, install or build a porject see the docs (TODO: add url to readthedocs)

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 funcion create_app initialize the Flask app, register blueprints and intialize all libraries like Swagger, database, trace system, custom logger format, etc.

pyms/flask/healthcheck

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

pyms/logger

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

pyms/rest_template

Encapsulate common rest operations between business services propagating trace headers if configured.

pyms/tracer

Create an injector flask_opentracing.FlaskTracer to use in our projects

Pipenv

Advantages over plain pip and requirements.txt

Pipenv generates two files: a Pipfileand a Pipfile.lock.

  • Pipfile: Is a high level declaration of the dependencies of your project. It can contain "dev" dependencies (usually test related stuff) and "standard" dependencies which are the ones you'll need for your project to function
  • Pipfile.lock: Is the "list" of all the dependencies your Pipfile has installed, along with their version and their hashes. This prevents two things: Conflicts between dependencies and installing a malicious module.

How to...

Here the most 'common' pipenv commands, for a more in-depth explanation please refer to the official documentation.

Install pipenv

pip install pipenv

Install dependencies defined in a Pipfile

pipenv install

Install both dev and "standard" dependencies defined in a Pipfile

pipenv install --dev

Install a new module

pipenv install django

Install a new dev module (usually test related stuff)

pipenv install nose --dev

Install dependencies in production

pipenv install --deploy

Start a shell

pipenv shell

Documentation

This project use MkDocs

  • mkdocs new [dir-name] - Create a new project.
  • mkdocs serve - Start the live-reloading docs server.
  • mkdocs build - Build the documentation site.
  • mkdocs help - Print this help message.

Project layout

mkdocs.yml    # The configuration file.
docs/
    index.md  # The documentation homepage.
    ...       # Other markdown pages, images and other files.

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

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

py_ms-1.0.0-py3.6.egg (39.0 kB view details)

Uploaded Egg

py_ms-1.0.0-py3-none-any.whl (58.6 kB view details)

Uploaded Python 3

File details

Details for the file py-ms-1.0.0.tar.gz.

File metadata

  • Download URL: py-ms-1.0.0.tar.gz
  • Upload date:
  • Size: 23.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.6.7

File hashes

Hashes for py-ms-1.0.0.tar.gz
Algorithm Hash digest
SHA256 43793092f52801d5bbda95c314c76c1541f91fee3984db31e8b242b14aa1ce47
MD5 c03367bdcc61b4360dd98f1c1007a197
BLAKE2b-256 744df1ae8d61ca0bd33718763ea40a06adc496d4472bafc70964bcbe950cfe37

See more details on using hashes here.

File details

Details for the file py_ms-1.0.0-py3.6.egg.

File metadata

  • Download URL: py_ms-1.0.0-py3.6.egg
  • Upload date:
  • Size: 39.0 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.6.7

File hashes

Hashes for py_ms-1.0.0-py3.6.egg
Algorithm Hash digest
SHA256 37f97d0762a11522501b6293862c45e47c8c7cc7daa7ea03cc0f5be6fcf6e7c4
MD5 b57a67b8856900a5bccefd67ed3fbc2f
BLAKE2b-256 d0ebe504aebaee7a5c5cf639d9005e4d410078078ef4f64b24ddc622276d13ce

See more details on using hashes here.

File details

Details for the file py_ms-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: py_ms-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 58.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.6.7

File hashes

Hashes for py_ms-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 88e9eaf2a0c0fb40c7210848a945e78143275a388a06127fdaba8496b5f0b8e7
MD5 164d8cfbfbc446a12798ca2894c94775
BLAKE2b-256 65756984684066e818eb8ae63d620a3d923a30cd7ae31cd18c9cb611f5e0ccfa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page