Python client SDK for Model Drive Protocol.
Project description
modeldriveprotocol-client
Python client SDK for Model Drive Protocol.
Install
pip install modeldriveprotocol-client
Quick start
import asyncio
from modeldriveprotocol import ClientInfo, MdpClient
async def main() -> None:
client = MdpClient(
"ws://127.0.0.1:47372",
ClientInfo(id="python-01", name="Python Client"),
)
client.expose_endpoint(
"/page/search",
"POST",
lambda request, _context: {
"query": request.body.get("query", "") if isinstance(request.body, dict) else "",
},
description="Search the current runtime.",
)
await client.connect()
await client.register()
asyncio.run(main())
Included transports
- WebSocket:
ws:///wss:// - HTTP loop:
http:///https://
Unlike the browser-focused JavaScript entrypoints, this SDK uses direct transport headers for runtime auth when needed.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file modeldriveprotocol_client-2.2.0.tar.gz.
File metadata
- Download URL: modeldriveprotocol_client-2.2.0.tar.gz
- Upload date:
- Size: 10.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e80d7acc1ce0041577df242ac93fc068658cdb31189a2a3f642a7151205b9a40
|
|
| MD5 |
8198521339ad370ce425d6fa7936be14
|
|
| BLAKE2b-256 |
07fe6bb1537d87d117ec916388c91aa10c6bb5f6f81ae57ab8ed53f256a35f06
|
File details
Details for the file modeldriveprotocol_client-2.2.0-py3-none-any.whl.
File metadata
- Download URL: modeldriveprotocol_client-2.2.0-py3-none-any.whl
- Upload date:
- Size: 12.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6c340ecc20e2a494c6e5a7d3a8a64251a67bb41fc296ce967d9e44eb10c86201
|
|
| MD5 |
c7cd5e117636a17a8fce1327b8b70e77
|
|
| BLAKE2b-256 |
af97a582e42a4ed549866357cee79e00767082990486772a53e40d95fb685b11
|