skillfed

telnetlib3

Python Telnet server and client CLI and Protocol library

telnetlib3 v5.0.0 1.7M downloads/30d#3,651 on PyPI173
Permissive license ISC Active released

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 telnetlib3

uv

uv add telnetlib3

poetry

poetry add telnetlib3

Installing 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

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: ISC License (ISCL)Programming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Topic :: InternetTopic :: System :: NetworkingTopic :: System :: ShellsTopic :: Terminals :: TelnetTyping :: Typed

Tags

telnet server client libraryasyncio telnet protocoltelnet CLI utilitiespython telnet implementationMUD BBS telnet supporttelnet with compression MCCPtelnet character encoding negotiation
telnet-protocolasyncio-readyretro-computing

More Internet packages