Skip to content

Mototli

Modern Gopher protocol server and client implementation using asyncio

Mototli is a Python library that brings the classic Gopher protocol (RFC 1436) into the modern era with full Gopher+ extensions (RFC 4266), async/await support, and a developer-friendly API.

  • Serve Content


    Host your own gopherhole with a full-featured async server supporting CGI, directory listings, and Gopher+ attributes.

    Quick Start

  • Fetch Resources


    Browse gopherspace programmatically with an elegant async client that handles directories, text, and binary content.

    Client Tutorial

  • CLI Tools


    Explore gopher servers from the command line with rich output formatting and Gopher+ support.

    CLI Reference

  • Gopher+ Ready


    Full support for Gopher+ extensions including attribute queries, alternate views, and admin information.

    Gopher+ Guide

Quick Example

import asyncio
from mototli.client import GopherClient

async def main():
    async with GopherClient() as client:
        response = await client.get("gopher.floodgap.com", "/")
        for item in response.items:
            print(f"[{item.item_type.value}] {item.display_text}")

asyncio.run(main())
import asyncio
from mototli.server import run_server

asyncio.run(run_server(document_root="./gopherhole"))
# Browse a gopher server
mototli get gopher.floodgap.com

# Serve a local directory
mototli serve ./my-gopherhole --port 7070

Installation

# Using uv (recommended)
uv add mototli

# Using pip
pip install mototli

Full installation guide

Key Features

Feature Description
Async/Await Built on asyncio for high-performance networking
Gopher+ Support Full RFC 4266 implementation with attributes and views
CLI Included Rich command-line interface for browsing and serving
TOML Config Flexible server configuration via TOML files
CGI Support Execute CGI scripts for dynamic content
Type Safe Full type hints and mypy strict mode

Project Status

Mototli is in active development:

  • Protocol definitions (RFC 1436)
  • Gopher+ extensions (RFC 4266)
  • Async client with directory/text/binary support
  • Full-featured async server
  • CGI script execution
  • Command-line interface
  • TOML configuration
  • TLS support (Gopher/S)
  • Caching layer

Next Steps