Code Monkey home page Code Monkey logo

grpyc's Introduction

gRPyC : A lightweight framework to ease developpment of multiple-services using gRPC with python

(Support windows only for now)

pypi <- Python package

File structuration :

sample project
│   requirements.txt <- Dependencies for this project developpment
│
└───services
│   └───service1
│   │   └───data                <- Sample database .json
│   │   └───pb2                 <- Where the pb2 generated files will be
│   │   │   service1.py         <- The servicer class file
│   │   │   Dockerfile          <- To easily deploy the service later with Docker
│   │   │   requirements.txt    <- Used by Docker to install dependencies
│   │
│   └───service2
│   └───...
│   │
│   └───client  <- The client folder, NB : It is not a service, and you can't name a service 'client'
│       │          It is for testing your services only, you can delete it if you test your service with something else
│       └───protos              <- pb2 for each service will be also generated here
│       │   client.py           <- The client main script used to make requests to our services to test them
│
└───protos
│   │   service1.proto <- Proto file for service1
│   │   service2.proto <- Proto file for service2
│   │   base.proto     <- Proto file imported in other proto files, not representing a service
│   │   ...NB : A the service name should be the same than its proto file name
│
└───venv <- We suggest you to use a virual environment

How to start :

  • Create your 'protos' & 'services' directories
  • Then run these commands (at the root of the project)
  • python -m venv venv (create a virtual environment)
  • Get in your freshly made virtual environment, then install grpyc :
  • pip install grpyc (PYPI)
  • Now you can run grpyc -ns myService1 to create a new service

Commands list

Command Description
-c, --compile-client Will compile all protos for each service and copy them into the client
-cs, --compile-service TEXT Will compile the given service
-s, --run-service TEXT Will run the given service
-ns, --new-service TEXT Will create a proto file and a dir for the service, run it with no text to create a client service
--help Show help

NB : These command must be executed at the root of your project, where your services and protos directories stand

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.