knocky
介绍
knocky包用于通信时帧头和帧正文处理解耦。
帧正文处理函数注册成knocky包的服务,帧头处理调用服务,调用knocky服务获取响应数据。
本软件包已上传到pypi,可输入命令直接安装。
pip install knocky
示例
import knocky as knock
def main():
knock.register(0, 5, service1)
print(knock.call(0, 5, bytearray([4, 5])))
def service1(req: bytearray, *args) -> (bytearray, bool):
print('service1 get req:', req, args)
return bytearray([1, 2, 3]), True
if __name__ == '__main__':
main()
输出:
service1 get req: bytearray(b'\x04\x05') ()
resp: (bytearray(b'\x01\x02\x03'), True)
Metadata
Release files for knocky 1.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 | Provenance | |
|---|---|---|---|---|
| knocky-1.1.tar.gz | 2.1 kB | Without provenance | Details |
Release files / knocky-1.1.tar.gz
| Download URL | knocky-1.1.tar.gz |
|---|---|
| Size | 2.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d143f57fddfecd01009727b1b7d5bc637b845a730fae391e49c77a7654e9c6f8
|
|
BLAKE2b-256 checksum How to use checksums |
4e477a9f304dd6e976293d8816310c52a8f2d085d5dde01c50795949a544929f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.8.7
|
Security for knocky 1.1
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.