Skip to main content

webmediator PyPI version

Python sync/async client for the WebMediator API.

pip install webmediator

Example 1: request/response

import webmediator

client = webmediator.Client('https://localhost:7263/mediator')

response = client.send('Ping', {'message':'EXAMPLE' })
print(response)

Console output:

type: Pong, data: {'message': 'EXAMPLE PONG'}

Example 2: Async request/response

import webmediator
import asyncio

async def main():
    client = webmediator.AsyncClient('http://localhost:5263/mediator')

    response = await client.send('Ping', {'message':'EXAMPLE' })
    print(response)

if __name__ == "__main__":
    asyncio.get_event_loop().run_until_complete(main())

More code...

Example 3: File upload/download

import webmediator

client = webmediator.Client('https://localhost:7263/mediator')

with open('example.txt','rb') as file: 
    client.send('FileUpload', { 'name': file.name, 'content': file })

with client.send('FileDownload', { 'name': file.name }) as response:
    content = response.data.read()
    print(content)

More code...

Example 4: Server-sent events

import webmediator
import asyncio

async def main():
    client = webmediator.AsyncClient('http://localhost:5263/mediator')

    async for sse in client.event_stream('ExampleAsyncEvents'):
        print(sse)

if __name__ == "__main__":
    asyncio.get_event_loop().run_until_complete(main())

More code...

Metadata

Release files for webmediator 1.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for webmediator 1.0.5
File Size Uploaded Provenance Actions
webmediator-1.0.5.tar.gz 8.1 kB Without provenance Details for webmediator-1.0.5.tar.gz

Release files / webmediator-1.0.5.tar.gz

Download URL webmediator-1.0.5.tar.gz
Size 8.1 kB
Tags Source
SHA-256 checksum
How to use checksums
cff1dea6ca5461359d4b7e3d071aea7072fd320e8f0fd07084f40e45c0684482
BLAKE2b-256 checksum
How to use checksums
5f1eaba1989a7eb8b13bc3fc5633f1b18754ad6e915aa67c7d30b5e0c6298751
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.2

Security for webmediator 1.0.5

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page