Skip to main content

C++ embedded Python microservices

Project description

C++嵌入式Python微服务

C++ embedded Python microservices

1 简介

locapip是一个小型gRPC运行框架,适用于内嵌Python解释器的C++项目。

结合locapic,可与虚幻引擎项目优雅集成

2 服务端

2.1 安装

python -m pip install locapip

2.2 启动

python -m locapip --port 6547 --config CONFIG_JSON

其中,CONFIG_JSON是配置文件的路径,定义启用的protobuf模块及其参数

{
  "test": {},
  "fit_fill": {},
  "explorer": {
    "working_directory": "d:/"
  },
  "your_protobuf_module": {
    "path": "path/to/your_protobuf_module.py"
  }
}

3 客户端

3.1 Python

TODO

3.2 C++

需结合C++接口locapic使用

locapic,借助pybind11的嵌入式Python解释器,提供了一套通用的C++接口使用locapip

TODO

4 自定义模块

服务端和客户端的具体实现方法,请参阅test.py源码,以及 gRPC PythonExamples

服务端和客户端都应能够访问同一版本的protobuf模块,因此配置文件中定义的模块名称和路径应相同

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

locapip-0.1.13.tar.gz (31.7 kB view details)

Uploaded Source

Built Distribution

locapip-0.1.13-py3-none-any.whl (41.8 kB view details)

Uploaded Python 3

File details

Details for the file locapip-0.1.13.tar.gz.

File metadata

  • Download URL: locapip-0.1.13.tar.gz
  • Upload date:
  • Size: 31.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for locapip-0.1.13.tar.gz
Algorithm Hash digest
SHA256 1b83de309fe0e5fd34e912dc983d7b5ae4e425347bcc49ca3662dc79502021a4
MD5 5c9aa522de4527dff673544c71d95522
BLAKE2b-256 9a2817ceef031f09068fecf1e675037b868f74cc19c364f56657334809407050

See more details on using hashes here.

File details

Details for the file locapip-0.1.13-py3-none-any.whl.

File metadata

  • Download URL: locapip-0.1.13-py3-none-any.whl
  • Upload date:
  • Size: 41.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for locapip-0.1.13-py3-none-any.whl
Algorithm Hash digest
SHA256 032f7a74d6054f752f0c38cc32bec5991157dcc26c556ecefa39218eae64377c
MD5 295cf6a66548ec5959c937b6d0eeb473
BLAKE2b-256 592f4ac973e8164beb1cebde51aa075495e6a8515fb365acd2075c12710ecef1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page