This release is a pre-release and may not be stable for production use.
Apache Dubbo for Python
Apache Dubbo is an easy-to-use, high-performance WEB and RPC framework with builtin service discovery, traffic management, observability, security features, tools and best practices for building enterprise-level microservices.
Dubbo-python is a Python implementation of the triple protocol (a protocol fully compatible with gRPC and friendly to HTTP) and various features designed by Dubbo for constructing microservice architectures.
Visit the official website for more information.
🚧 Early-Stage Project 🚧
Disclaimer: This project is in the early stages of development. Features are subject to change, and some components may not be fully stable. Contributions and feedback are welcome as the project evolves.
Features
- Service Discovery: Zookeeper
- Load Balance: Random, CPU
- RPC Protocols: Triple(gRPC compatible and HTTP-friendly)
- Transport: asyncio(uvloop)
- Serialization: Customizable(protobuf, json...)
Installation
Before you start, make sure you have python 3.11+ installed.
-
Install from source
git clone https://github.com/apache/dubbo-python.git cd dubbo-python && pip install .
Getting started
Get up and running with Dubbo-Python in just 5 minutes by following our Quick Start Guide.
It's as simple as the code snippet below. With just a few lines of code, you can launch a fully functional point-to-point RPC service:
-
Build and start the server
import dubbo from dubbo.configs import ServiceConfig from dubbo.proxy.handlers import RpcMethodHandler, RpcServiceHandler class UnaryServiceServicer: def say_hello(self, message: bytes) -> bytes: print(f"Received message from client: {message}") return b"Hello from server" def build_service_handler(): # build a method handler method_handler = RpcMethodHandler.unary( method=UnaryServiceServicer().say_hello, method_name="unary" ) # build a service handler service_handler = RpcServiceHandler( service_name="org.apache.dubbo.samples.HelloWorld", method_handlers=[method_handler], ) return service_handler if __name__ == "__main__": # build service config service_handler = build_service_handler() service_config = ServiceConfig( service_handler=service_handler, host="127.0.0.1", port=50051 ) # start the server server = dubbo.Server(service_config).start() input("Press Enter to stop the server...\n")
-
Build and start the Client
import dubbo from dubbo.configs import ReferenceConfig class UnaryServiceStub: def __init__(self, client: dubbo.Client): self.unary = client.unary(method_name="unary") def say_hello(self, message: bytes) -> bytes: return self.unary(message) if __name__ == "__main__": # Create a client reference_config = ReferenceConfig.from_url( "tri://127.0.0.1:50051/org.apache.dubbo.samples.HelloWorld" ) dubbo_client = dubbo.Client(reference_config) unary_service_stub = UnaryServiceStub(dubbo_client) # Call the remote method result = unary_service_stub.say_hello(b"Hello from client") print(result)
License
Apache Dubbo-python software is licensed under the Apache License Version 2.0. See the LICENSE file for details.
Metadata
Release files for apache-dubbo 3.0.0b1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| apache-dubbo-3.0.0b1.tar.gz | 73.4 kB | Without provenance | Details for apache-dubbo-3.0.0b1.tar.gz |
Release files / apache-dubbo-3.0.0b1.tar.gz
| Download URL | apache-dubbo-3.0.0b1.tar.gz |
|---|---|
| Size | 73.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8afc5501360df0ab8b01b372687b16c5142dcc1cfb165018d8c03281afad2b5c
|
|
BLAKE2b-256 checksum How to use checksums |
a341fc5470047e8fd433432c8212f5bcb3bdaed30a0965b79ffeffc46cfd6890
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.11.5
|
Security for apache-dubbo 3.0.0b1
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.