Giter Site home page Giter Site logo

sivakov512 / python-microservice-template Goto Github PK

View Code? Open in Web Editor NEW
8.0 2.0 2.0 25 KB

Cookiecutter template to generate python grpc microservices

License: MIT License

Nix 21.33% Makefile 3.60% Python 49.86% Shell 5.21% Dockerfile 12.93% Smarty 7.06%
python cookiecutter grpc microservice protobuf asyncio

python-microservice-template's Introduction

Python microservice template

Cookiecutter template to generate python grpc microservices.

Look at generated service example and example protocol buffer repository.

What's included

  • Nix shell configuration to start faster than anybody if you use Nix
  • Poetry to manage dependencies and all the Python staff
  • Few GRPC and protocol buffers related libs
  • Great PostgreSQL driver asyncpg and pretty wrapper asyncpg-engine
  • Click based cli
  • Some linting staff, like flake8 with a lot of plugins, isort, mypy and black formatter (already configured!)
  • pytest and some required plugins
  • Nice pdb replacement pdb++
  • Simple helm chart to deploy to k8s
  • Github Actions workflow with testing, releasing to Github Registry and deployment setup to Yandex.Cloud

Github Actions

Before using Github Actions you should add PAT as secret named ROBOT_TOKEN (use special robot user, but personal token is okay too), otherwise CI will fail on git submodules checkout.

Also you should complete the following steps to deploy to Yandex.Cloud:

Helm

Helm chart in repo is really very simple. You should edit it manually if you need some customization (and you need it).

Database migrations

You can see that Github Actions, Dockerfile and k8s use go-migrate tool to migrate database. All existing migration tools are bad, but this tool is best of them. So it is my preferred choice.

License

There are no LICENSE file in generated project, so add it yourself.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.