Skip to content

Simple client/server app gives an exchange rates (Python, gRPC)

Notifications You must be signed in to change notification settings

victorkryz/EX-Rates

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

$\color{MidnightBlue}\textit{\textbf{EX-Rates}}$

Python gRPC

Small Python client/server app that communicates by gRPC protocol and provides currency exchange rates

Prerequisites:

  • Python 3.7 or higher
  • Install gRPC Python scaffold (grpcio, grpcio-tools) as it described in gRPC tutorial.

Run app:

  • Run the server:

     python ex_rates_svc.py
    
  • Run the client providing currency code like USD, EUR, UAH, GBP, etc. as a command line parameter:

     python ex_rates_clnt.py USD
    

    The client prints the rates of the specified currency against to others

Update/generate gRPC code:

For (re)generation of gRPC code integrated into application use grpc_tools.
Run it from the project's root directory:

python -m grpc_tools.protoc -I./protos --python_out=gen --pyi_out=gen --grpc_python_out=gen protos/ex-rates.proto

The generated code drops into gen subfolder

About

Simple client/server app gives an exchange rates (Python, gRPC)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages