Sans-IO telnet parser
Project description
telnetio
A Sans-IO implementation of a telnet parser.
Includes an anyio
server implementation. To install use the anyio
extra, such as pip install telnetio[anyio]
.
import anyio
from anyio.abc import AnyByteStream
from telnetio import AnyioTelnetServer
async def handler(stream: AnyByteStream) -> None:
async with stream, AnyioTelnetServer(stream) as telnet:
async for data in telnet:
await telnet.send(data)
async def main() -> None:
listener = await anyio.create_tcp_listener(local_port=1234)
await listener.serve(handler)
anyio.run(main)
See the examples
directory for more examples.
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
telnetio-0.3.0.tar.gz
(6.5 kB
view hashes)