Py-ms

Latest version: v2.8.0

Safety actively analyzes 630217 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 3 of 5

2.2.0

**Features**
- **Create project from scaffold** 90
PyMS has a command line option to create a project template like [Microservices Scaffold](https://github.com/python-microservices/microservices-scaffold).
This command use [cookiecutter](https://github.com/cookiecutter/cookiecutter) to download and install this [template](https://github.com/python-microservices/microservices-template)
**[Warning]** You must run first `pip install cookiecutter==1.7.0`
bash
pyms startproject

this output a lot of options step by step:
bash
project_repo_url [https://github.com/python-microservices/microservices-scaffold]:
project_name [Python Microservices Boilerplate]: example project
project_folder [example_project]:
project_short_description [Python Boilerplate contains all the boilerplate you need to create a Python package.]:
create_model_class [y]:
microservice_with_swagger_and_connexion [y]:
microservice_with_traces [y]:
microservice_with_metrics [y]:
application_root [/example_project]:
Select open_source_license:
1 - MIT license
2 - BSD license
3 - ISC license
4 - Apache Software License 2.0
5 - GNU General Public License v3
6 - Not open source
Choose from 1, 2, 3, 4, 5, 6 [1]:

When you finish to introduce the options, a project will be created in `[project_folder]` folder

- **Encrypt/decrypt config** (86)
- New encryption and decryption feature with [AES](https://en.wikipedia.org/wiki/Advanced_Encryption_Standard)
- Create a key to encrypt config with new command line `pyms create-key`
- Encrypt a string with the new command line `pyms encrypt [STRING]`
- Set the key file with new environment variable `KEY_FILE`
- If you set in your config a var with the prefix "ENC_" or "enc_" PyMS search for the key file and decrypt the string. Now you can encrypt your database url for production environments. I.E.:
yaml
pyms:
[...]
config:
ENC_DATABASE: gAAAAABeSZ714r99iRIxhoH77vTdRJ0iqSymShfqgGN9PJveqhQWmshRDuV2a8sATey8_lHkln0TwezczucH-aJHGP_LyEiPxwM-88clNa7FB1u4g7Iaw3A=

you can access it in your code with `current_app.config["DATABASE"] == "http://database-url"`

- **Human readable config errors** 85
Show more help information if the config file not have a good structure with error messages like


Config file must start with `pyms` keyword, for example:
pyms:
services:
metrics: true
requests:
data: data
swagger:
path: ""
file: "swagger.yaml"
tracer:
client: "jaeger"
host: "localhost"
component_name: "Python Microservice"
config:
DEBUG: true
TESTING: true

- **Add service name label by default** 84 - alexppg
It adds a label to all jaeger's generated metrics that can be used to identify every microservice.
See jaegertracing/jaeger-client-python269.
I messed up the previous PR, it's the same as this. https://github.com/python-microservices/pyms/pull/72

**Fixes**
- Send `path` to `ConfFile` from `Microservice` class to set path from code if you want to not use `CONFIGMAP_FILE` from env

**Refactors**
- Refactor config. Memoize of files moved to new class

2.1.0

**Features**
* Refactor config:
* Memoize config file to prevent open each time access to the configuration
* Removed "uppercase" parameter, created `to_flask()` method to uppercase attrs to create Flask config
* Reload config from file. First step to solve the issue 71
* Reload services and app when the configuration was reloaded with `Microservice.reload()` method. First step to solve the issue 71

**Fix**
* Removed memoize of service. This feature create an error on tests when create a instance of Microservice out of tests

2.0.0

**Features**
* Refactor config. Issue 75 (78)
* Added RestyResolver to connexion, issue 39 (74)
* Set swagger url by config file (73)

**Fix**
* Fix tracers and logging Working outside of application context (76)
* Fix pylint not executed in service folder (69)
* Updated tox and dependencies (77)

2.0.0rc1

**Features**
* Refactor config. Issue 75 (78)
* Added RestyResolver to connexion, issue 39 (74)
* Set swagger url by config file (73)

**Fix**
* Fix tracers and logging Working outside of application context (76)
* Fix pylint not executed in service folder (69)
* Updated tox and dependencies (77)

1.5.0

**New functionalities:**
* Memoizes config file per service
* Updates dependencies
* Created [metrics as a service](https://py-ms.readthedocs.io/en/latest/services/metrics)

HELP flask_request_latency_seconds Flask Request Latency
TYPE flask_request_latency_seconds histogram

1.4.1

**New functionalities:**
- Removed tracer from core
- Created tracer as a service
- Configure tracer between jaeger and lightstep from config.yml
- Set tracer host from config.yml
- Check if package is installed

**Bugs fixed:**
- Fix Coveralls. Not push coverage since 07/2019
- Fix error when swagger service not present in config.yml

Page 3 of 5

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.