Argumentation Microservices
This project contains Protobuf definitions for building complex argumentation machines. The idea is to facilitate a microservice-oriented architecture where individual parts can be swapped out easily. Along with the Protobuf files, the project also contains code for generating libraries for multiple programming languages that are released as packages in their respective registries:
Documentation can be found at the Buf Schema Registry.
Build Locally
buf generate && uv build
Runtimes
All messages (*_pb2.py) use the official protobuf runtime.
Install the extra for the RPC runtime you want to use, both share the same messages:
| Extra | Install | Services | Helpers |
|---|---|---|---|
grpcio |
uv add arg-services[grpcio] |
*_pb2_grpc.py (grpcio) |
arg_services.grpcio |
connectrpc |
uv add arg-services[connectrpc] |
*_connect.py (connectrpc) |
arg_services.connectrpc |
Validation
arg_services.validation checks requests independently of the runtime and raises a ValidationError.
Add the ValidationInterceptor of your runtime to report it as INVALID_ARGUMENT, e.g., serve(..., interceptors=[ValidationInterceptor()]).
To pass the traceback of unhandled exceptions to gRPC clients, also add arg_services.grpcio.ExceptionInterceptor().
For asyncio servicers, use arg_services.grpcio.serve_async with AsyncValidationInterceptor() and AsyncExceptionInterceptor() instead.
from arg_services.validation import require_all
require_all(["texts", "config.language"], request)
require_all(["text"], *request.items)
Connect
Connect services are plain ASGI/WSGI applications that also speak gRPC, so existing gRPC clients keep working.
gRPC clients and reflection need a server with HTTP/2 trailers such as pyvoy, Connect clients work with any server such as uvicorn or gunicorn.
Since connectrpc-grpcreflect only supports protobuf-py, use arg_services.connectrpc.reflection_app to serve gRPC reflection.
from arg_services.connectrpc import ValidationInterceptor, reflection_app
from arg_services.nlp.v1 import nlp_pb2
from arg_services.nlp.v1.nlp_connect import NlpService, NlpServiceASGIApplication
from arg_services.validation import require_all
from connectrpc.request import RequestContext
from starlette.applications import Starlette
from starlette.routing import Mount
class Nlp(NlpService):
async def vectors(
self, request: nlp_pb2.VectorsRequest, ctx: RequestContext
) -> nlp_pb2.VectorsResponse:
require_all(["texts"], request)
return nlp_pb2.VectorsResponse()
nlp_app = NlpServiceASGIApplication(Nlp(), interceptors=[ValidationInterceptor()])
reflection = reflection_app(nlp_app)
app = Starlette(
routes=[Mount(nlp_app.path, nlp_app), Mount(reflection.path, reflection)]
)
Metadata
Release files for arg-services 2.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| arg_services-2.0.1.tar.gz | 90.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| arg_services-2.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 234.5 kB
Release files / arg_services-2.0.1.tar.gz
| Download URL | arg_services-2.0.1.tar.gz |
|---|---|
| Size | 90.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
140b247aa1c79662237984c891140d040ccaafef82bbd36a0c43afc367b48e99
|
|
BLAKE2b-256 checksum How to use checksums |
d39ad296ccfbbccff3b98793c8620631b250e123a4068516bff0cf0003f6eb93
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.
Transparency logRelease files / arg_services-2.0.1-py3-none-any.whl
| Download URL | arg_services-2.0.1-py3-none-any.whl |
|---|---|
| Size | 144.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8dac13f1b552fba64dee01e8d07ac2f2141ba970176d0f18a4a100db5d25f212
|
|
BLAKE2b-256 checksum How to use checksums |
d98799b65742fd5767a248746fa325f559afc522624ae76cc66890befdc60652
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.
Transparency log