From e2f569768bb60b952ab0a8c8234031b4f68c7e50 Mon Sep 17 00:00:00 2001 From: dockerzhang Date: Mon, 2 Nov 2020 17:52:43 +0800 Subject: [PATCH] [TUBEMQ-383] add readme for installation and example --- .../tubemq-client-python/README.md | 29 +++++++++++++++++++ .../src/python/example/README.md | 4 +++ .../python/example/{ => consumer}/client.conf | 0 .../example/{ => consumer}/test_consumer.py | 0 4 files changed, 33 insertions(+) create mode 100644 tubemq-client-twins/tubemq-client-python/README.md create mode 100644 tubemq-client-twins/tubemq-client-python/src/python/example/README.md rename tubemq-client-twins/tubemq-client-python/src/python/example/{ => consumer}/client.conf (100%) rename tubemq-client-twins/tubemq-client-python/src/python/example/{ => consumer}/test_consumer.py (100%) diff --git a/tubemq-client-twins/tubemq-client-python/README.md b/tubemq-client-twins/tubemq-client-python/README.md new file mode 100644 index 00000000000..7d9fea1955d --- /dev/null +++ b/tubemq-client-twins/tubemq-client-python/README.md @@ -0,0 +1,29 @@ +### TubeMQ Python Client +TubeMQ Python Client library is a wrapper over the existing [C++ client library](https://github.com/apache/incubator-tubemq/tree/master/tubemq-client-twins/tubemq-client-cpp/) and exposes all of the same features. + +#### Install from source +##### install python-devel +- build and install C++ client SDK +build C++ client SDK from source, and install: +1, copy `tubemq` include directory to `/usr/local/include/` +2, copy `libtubemq_rel.a` to `/usr/local/lib` +  + +- install python-devel +``` +yum install python-devel -y +``` +- install required dependency +``` +pip install -r requirements.txt +``` + +- install client +``` +pip install ./ +``` + +#### Examples +##### Producer example +##### Consumer example +Consumer example is [available](https://github.com/apache/incubator-tubemq/tree/master/tubemq-client-twins/tubemq-client-python/src/python/example/consumer). \ No newline at end of file diff --git a/tubemq-client-twins/tubemq-client-python/src/python/example/README.md b/tubemq-client-twins/tubemq-client-python/src/python/example/README.md new file mode 100644 index 00000000000..dc8c29181fb --- /dev/null +++ b/tubemq-client-twins/tubemq-client-python/src/python/example/README.md @@ -0,0 +1,4 @@ +### TubeMQ Python Client Example +- Consumer example +Consume example reference to [C++ test_consumer](https://github.com/apache/incubator-tubemq/tree/master/tubemq-client-twins/tubemq-client-cpp/example/consumer), +and all methods exposed based on [pybind11](https://pybind11.readthedocs.io/en/stable/basics.html). \ No newline at end of file diff --git a/tubemq-client-twins/tubemq-client-python/src/python/example/client.conf b/tubemq-client-twins/tubemq-client-python/src/python/example/consumer/client.conf similarity index 100% rename from tubemq-client-twins/tubemq-client-python/src/python/example/client.conf rename to tubemq-client-twins/tubemq-client-python/src/python/example/consumer/client.conf diff --git a/tubemq-client-twins/tubemq-client-python/src/python/example/test_consumer.py b/tubemq-client-twins/tubemq-client-python/src/python/example/consumer/test_consumer.py similarity index 100% rename from tubemq-client-twins/tubemq-client-python/src/python/example/test_consumer.py rename to tubemq-client-twins/tubemq-client-python/src/python/example/consumer/test_consumer.py