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)
pip install py-ms
Module to read yaml or json configuration from a dictionary or a path.
With the funcion create_app
initialize the Flask app, register blueprints
and intialize all libraries like Swagger, database, trace system, custom logger format, etc.
This views is usually used by Kubernetes, Eureka and other systems to check if our application is up and running.
Print logger in JSON format to send to server like Elasticsearch. Inject span traces in logger.
Encapsulate common rest operations between business services propagating trace headers if configured.
Create an injector flask_opentracing.FlaskTracer
to use in our projects
Pipenv generates two files: a Pipfile
and 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 functionPipfile.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.
Here the most 'common' pipenv
commands, for a more in-depth explanation please refer to the official documentation.
pip install pipenv
pipenv install
pipenv install --dev
pipenv install django
pipenv install nose --dev
pipenv install --deploy
pipenv shell
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.
mkdocs.yml # The configuration file.
docs/
index.md # The documentation homepage.
... # Other markdown pages, images and other files.