@architect-io/python-launcher
v0.1.14
Published
Launcher for Architect.io supporting python services
Downloads
58
Readme
architect-python-launcher
Python launcher for the architect CLI
Injection Schema
Example .proto file
syntax = "proto3";
message RecommendationRequest {
string user_id = 1;
int32 page_number = 2;
int32 result_per_page = 3;
}
message RecommendationResponse {
// ...
}
service MovieService {
rpc RecommendationsByUserId (RecommendationRequest) returns (RecommendationResponse) {}
}
Example architect.json
{
"name": "my-service",
"main": "main.py",
"language": "python",
"proto": "main.proto",
"dependencies": {
"dependency-name": "1.2.3"
}
}
Main file schema
class MyService():
dependencies = ['dependency-1', 'dependency-2', /* ... */]
def __init__(self, dependency_1, dependency_2, /* ... */):
self.dependency_1 = dependency_1
self.dependency_2 = dependency_2
# ...
def RecommendationsByUserId(self, request, context):
user_id = request.user_id
page_number = request.page_number
results_per_page = request.results_per_page
# Make calls to dependencies as needed....
dependency_request = self.dependency_service['messages'].DependencyRequest()
dependency_response = self.dependency_service['client'].CallDependency(dependency_request)
recommendation_response = self.recommendation_service['messages'].RecommendationResponse()
return recommendation_response