telnetlib3
Python Telnet server and client CLI and Protocol library
What it is and what it does
Telnetlib3 is a feature-rich Telnet implementation that provides both asyncio-based and synchronous blocking APIs for building telnet servers and clients. It implements RFC specifications for telnet protocol negotiation, including support for binary transmission, character encoding negotiation, compression (MCCP2/MCCP3), terminal type detection, and window size reporting. The library includes command-line utilities (telnetlib3-client, telnetlib3-server) for quick telnet connections and hosting, plus fingerprinting tools. For Python 3.13+, it provides a drop-in shim for the removed standard telnetlib module, allowing existing code to continue working unchanged.
The package is designed for developers building MUD (Multi-User Dungeon) and BBS (Bulletin Board System) servers, retro computing applications, and other telnet-based systems. It handles encoding negotiation automatically when possible, supports raw mode for non-compliant servers, and can host external programs via pseudo-terminal (PTY) execution. Dependencies are minimal (blessed for terminal handling, wcwidth for character width calculation), and the codebase is actively maintained with broad Python version support.
Use it for:
- Build a telnet server for a MUD or interactive game with custom shell logic and protocol negotiation
- Connect to legacy BBS systems or telnet servers with automatic or manual encoding handling (cp437, big5bbs, ATASCII)
- Host a CLI/TUI program (e.g., bash, bc) as a telnet service with optional linemode or raw mode
- Migrate Python 3.13+ code that relied on the standard telnetlib module by installing telnetlib3 as a drop-in replacement
- Implement telnet client automation scripts that negotiate compression and terminal capabilities with remote servers
- Fingerprint telnet servers to detect their capabilities and protocol support
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Telnet server, client, and protocol library for Python 3.9+ with asyncio and blocking API support, including CLI utilities and a backport of the removed telnetlib module for Python 3.13+.
Yes. The package is actively maintained, has no known vulnerabilities, low install friction, and a permissive license. It fills a genuine gap left by the removal of telnetlib in Python 3.13 and provides a modern, well-specified implementation for telnet server/client work. Install it if you need telnet support, are migrating from the standard library, or are building MUD/BBS infrastructure.
Install
telnetlib3 on PyPI
pip
pip install telnetlib3uv
uv add telnetlib3poetry
poetry add telnetlib3Installing telnetlib3
Before you install
Low friction: pure Python wheel with only two runtime dependencies (blessed, wcwidth). Actively maintained with a release 7 days ago. Supports Python 3.9 through 3.14.
License in practice
ISC license is permissive and poses no restrictions on use, modification, or distribution in commercial or private projects.
Quickstart
import asyncio
import telnetlib3
async def shell(reader, writer):
writer.write('Hello\r\n')
await writer.drain()
writer.close()
async def main():
server = await telnetlib3.create_server(port=6023, shell=shell)
await server.wait_closed()
asyncio.run(main())
Requires Python 3.9 or newer; asyncio event loop required for async API.
Verify before relying
- Whether the blocking API is feature-complete relative to the asyncio interface
- Performance characteristics under high concurrency or large message volumes
- Compatibility with non-standard telnet implementations beyond the RFC specifications listed
Package facts
| License | ISC (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — blessed, wcwidth |
| Maintenance | actively maintained — 7 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,686,695/month — #3,651 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: telnetlib3-5.0.0-py3-none-any.whl
Keywords: api, asyncio, bbs, client, cp437, library, mud, pty, server, telnet, utf8
Tags
More Internet packages
Botocore provides low-level, data-driven access…
permissive · top 100 on PyPI
aiobotocoreProvides an async client for AWS services using…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
filelockProvides a platform-independent file locking…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
googleapis-common-protosProvides common Protocol Buffer message…
permissive · top 100 on PyPI
standard-telnetlibProvides the telnetlib module removed from…
permissive · top 15,000 on PyPI
aiovlcControl VLC media player over a telnet…
permissive · top 15,000 on PyPI
tlslite-ngPure Python implementation of SSL/TLS protocols…
copyleft · top 15,000 on PyPI
websocket-clientwebsocket-client provides a Python WebSocket…
permissive · top 1,000 on PyPI
aioquicaioquic implements QUIC and HTTP/3 network…
permissive · top 5,000 on PyPI
websocketswebsockets is a library for building WebSocket…
permissive · top 100 on PyPI
scrapliscrapli is a Python library for connecting to…
permissive · top 15,000 on PyPI
qh3qh3 is a Python library implementing the QUIC…
permissive · top 5,000 on PyPI
smbprotocolSMBv2 and SMBv3 client library for Python that…
permissive · top 5,000 on PyPI
factorio-rcon-pyA Python client library for connecting to and…
copyleft · top 15,000 on PyPI