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 Python
和 Examples
服务端和客户端都应能够访问同一版本的protobuf模块,因此配置文件中定义的模块名称和路径应相同
Metadata
Release files for locapip 0.1.17
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 |
|---|---|---|---|---|
| locapip-0.1.17.tar.gz | 32.2 kB | Without provenance | Details for locapip-0.1.17.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| locapip-0.1.17-py3-none-any.whl | Python 3 | none | any | Details for locapip-0.1.17-py3-none-any.whl |
Total release size: 74.6 kB
Release files / locapip-0.1.17.tar.gz
| Download URL | locapip-0.1.17.tar.gz |
|---|---|
| Size | 32.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a4b46efbfa2f677465b1c91eb70cab6d9c33f2a2c9441bbf9021c66f0809b8e0
|
|
BLAKE2b-256 checksum How to use checksums |
24ad851c55b052e40e97a282182337df836e947bc03b67077306b3b4292ac2b8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / locapip-0.1.17-py3-none-any.whl
| Download URL | locapip-0.1.17-py3-none-any.whl |
|---|---|
| Size | 42.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
016b2a4f617f7efcdf1272a06bfba673bb65a7e82a3b9f3df10d6e1182329783
|
|
BLAKE2b-256 checksum How to use checksums |
60d311c4c1989f6cdcf47281451832965fd4efc22a54427aa0e082086b52b2d7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Security for locapip 0.1.17
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.