66[ ![ Requirements Status] ( https://requires.io/github/python-microservices/pyms/requirements.svg?branch=master )] ( https://requires.io/github/python-microservices/pyms/requirements/?branch=master )
77[ ![ Total alerts] ( https://img.shields.io/lgtm/alerts/g/python-microservices/pyms.svg?logo=lgtm&logoWidth=18 )] ( https://lgtm.com/projects/g/python-microservices/pyms/alerts/ )
88[ ![ Language grade: Python] ( https://img.shields.io/lgtm/grade/python/g/python-microservices/pyms.svg?logo=lgtm&logoWidth=18 )] ( https://lgtm.com/projects/g/python-microservices/pyms/context:python )
9+ [ ![ Gitter] ( https://img.shields.io/gitter/room/DAVFoundation/DAV-Contributors.svg )] ( https://gitter.im/python-microservices/pyms )
910
10- PyMS, Python MicroService, is a collections of libraries, best practices and recommended ways to build
11- microservices with Python.
11+
12+ PyMS, Python MicroService, is a collections of libraries, best practices and recommended ways to build microservices with Python.
1213
1314## Documentation
1415
15- To know how use, install or build a project see the docs: https://py-ms.readthedocs.io/en/latest/
16+ To know how use, install or build a project see the [ docs] ( https://py-ms.readthedocs.io/en/latest/ ) .
1617
1718## Motivation
1819
1920When we started to create microservice with no idea, we were looking for tutorials, guides, best practices, but we found
2021nothing to create professional projects. Most articles say:
22+
2123- "Install flask"
2224- "Create routes"
2325- (Sometimes) "Create a swagger specs"
2426- "TA-DA! you have a microservice"
2527
26- But... what happens with our configuration out of code like Kubernetes configmap? what happens with transactionality?
28+ But... what happens with our configuration out of code like Kubernetes configmap? what happens with transactionality?
2729If we have many microservices, what happens with traces?.
2830
2931There are many problems around Python and microservices and we can`t find anyone to give a solution.
3032
31- We start creating these projects to try to solve all the problems we have found in our professional lives about
33+ We start creating these projects to try to solve all the problems we have found in our professional lives about
3234microservices architecture.
3335
34- Nowadays, is not perfect and we have a looong roadmap, but we hope this library could help other felas and friends ;)
36+ Nowadays, is not perfect and we have a looong roadmap, but we hope this library could help other felas and friends ;)
3537
38+ ## Installation
3639
37- ## Installation
3840``` bash
3941pip install py-ms
4042```
@@ -43,7 +45,8 @@ pip install py-ms
4345
4446You need to create 2 files: main.py and config.yml:
4547
46- main.py
48+ - ** main.py**
49+
4750``` python
4851from flask import jsonify
4952
@@ -62,9 +65,10 @@ if __name__ == '__main__':
6265 app.run()
6366```
6467
65- config.yml
68+ - ** config.yml**
69+
6670``` yaml
67- pyms :
71+ pyms :
6872 services : # 1.2
6973 requests :
7074 data : {}
@@ -77,19 +81,22 @@ pyms:
7781
7882### So what did that code do?
7983
80- 1. Create a instance of PyMS Microservice class (#1.1). This initialization inject the configuration defined in the
81- 1.3 block and could be accessed through current_app.config like typical
82- [Flask config](https://flask.palletsprojects.com/en/1.1.x/config/).
84+ 1. Create a instance of PyMS Microservice class (#1.1). This initialization inject the configuration defined in the
85+ 1.3 block and could be accessed through current_app.config like typical
86+ [Flask config](https://flask.palletsprojects.com/en/1.1.x/config/).
8387Then, initialize the service defined in the 1.2 block. See [Services](services.md) for more details.
84- 2. Initialize [Flask](https://flask.palletsprojects.com/en/1.1.x/) instance, [Connexion](https://github.com/zalando/connexion)
85- if it was defined in the pyms configuration block, create a tracer, add health-check blueprint, initialize libs and set
86- the PyMS Microservice in
87- ` ms` attribute and you can access to it with `current_app.ms`. This steps has their each functions and you can easy
88+
89+ 2. Initialize [Flask](https://flask.palletsprojects.com/en/1.1.x/) instance, [Connexion](https://github.com/zalando/connexion)
90+ if it was defined in the pyms configuration block, create a tracer, add health-check blueprint, initialize libs and set
91+ the PyMS Microservice in ` ms` attribute and you can access to it with `current_app.ms`.
92+ This steps has their each functions and you can easy
8893override it.
94+
89953. `create_app` return the flask instance and you can interact with it as a typical flask app
9096
91- See Documentation https://py-ms.readthedocs.io/en/latest/ to learn more.
97+ See [ Documentation]( https://py-ms.readthedocs.io/en/latest/) to learn more.
9298
9399# # How To Contrib
94- We appreciate opening issues and pull requests to make PyMS even more stable & useful! See [This doc](COONTRIBUTING.md)
95- for more details
100+
101+ We appreciate opening issues and pull requests to make PyMS even more stable & useful! See [This doc](CONTRIBUTING.md)
102+ for more details.
0 commit comments